mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-04 04:13:49 +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,
|
navigateFunc: (scr: string, params?: any) => void,
|
||||||
currentScreenName: string,
|
currentScreenName: string,
|
||||||
showFileImportButton = true,
|
showFileImportButton = true,
|
||||||
|
onDismiss?: () => void,
|
||||||
): Promise<string | null> {
|
): Promise<string | null> {
|
||||||
return requestCameraAuthorization().then(() => {
|
return requestCameraAuthorization().then(() => {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const params = {
|
const params = {
|
||||||
showFileImportButton: Boolean(showFileImportButton),
|
showFileImportButton: Boolean(showFileImportButton),
|
||||||
onBarScanned: (data: any) => {},
|
onBarScanned: (data: any) => {},
|
||||||
onDismiss: () => {},
|
onDismiss,
|
||||||
};
|
};
|
||||||
|
|
||||||
params.onBarScanned = function (data: any) {
|
params.onBarScanned = function (data: any) {
|
||||||
|
@ -29,10 +30,6 @@ function scanQrHelper(
|
||||||
navigateFunc(currentScreenName);
|
navigateFunc(currentScreenName);
|
||||||
};
|
};
|
||||||
|
|
||||||
params.onDismiss = function () {
|
|
||||||
setTimeout(() => resolve(null), 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
navigateFunc('ScanQRCodeRoot', {
|
navigateFunc('ScanQRCodeRoot', {
|
||||||
screen: 'ScanQRCode',
|
screen: 'ScanQRCode',
|
||||||
params,
|
params,
|
||||||
|
|
|
@ -410,6 +410,8 @@ ScanQRCode.initialParams = {
|
||||||
urTotal: undefined,
|
urTotal: undefined,
|
||||||
urHave: undefined,
|
urHave: undefined,
|
||||||
backdoorText: '',
|
backdoorText: '',
|
||||||
|
onDismiss: undefined,
|
||||||
|
showFileImportButton: true,
|
||||||
backdoorVisible: false,
|
backdoorVisible: false,
|
||||||
animatedQRCodeData: {},
|
animatedQRCodeData: {},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue