mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-03 20:07:11 +01:00
Merge pull request #5989 from BlueWallet/scandismiss
FIX: DIsmissing Scanner would result in undefined reject
This commit is contained in:
commit
c72a716937
2 changed files with 4 additions and 5 deletions
|
@ -15,13 +15,14 @@ function scanQrHelper(
|
|||
navigateFunc: (scr: string, params?: any) => void,
|
||||
currentScreenName: string,
|
||||
showFileImportButton = true,
|
||||
onDismiss?: () => void,
|
||||
): Promise<string | null> {
|
||||
return requestCameraAuthorization().then(() => {
|
||||
return new Promise(resolve => {
|
||||
const params = {
|
||||
showFileImportButton: Boolean(showFileImportButton),
|
||||
onBarScanned: (data: any) => {},
|
||||
onDismiss: () => {},
|
||||
onDismiss,
|
||||
};
|
||||
|
||||
params.onBarScanned = function (data: any) {
|
||||
|
@ -29,10 +30,6 @@ function scanQrHelper(
|
|||
navigateFunc(currentScreenName);
|
||||
};
|
||||
|
||||
params.onDismiss = function () {
|
||||
setTimeout(() => resolve(null), 1);
|
||||
};
|
||||
|
||||
navigateFunc('ScanQRCodeRoot', {
|
||||
screen: 'ScanQRCode',
|
||||
params,
|
||||
|
|
|
@ -410,6 +410,8 @@ ScanQRCode.initialParams = {
|
|||
urTotal: undefined,
|
||||
urHave: undefined,
|
||||
backdoorText: '',
|
||||
onDismiss: undefined,
|
||||
showFileImportButton: true,
|
||||
backdoorVisible: false,
|
||||
animatedQRCodeData: {},
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue