REF: Use Error type

This commit is contained in:
Marcos Rodriguez Velez 2023-12-25 17:22:49 -04:00
parent 1ed33b1091
commit 42aefe9e27
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
4 changed files with 4 additions and 4 deletions

View file

@ -86,7 +86,7 @@ export default class SyncedAsyncStorage {
console.log('saved, seq num:', text); console.log('saved, seq num:', text);
resolve(text); resolve(text);
}) })
.catch(reason => reject(reason)); .catch((reason: Error) => reject(reason));
}); });
} }

View file

@ -72,7 +72,7 @@ const QRCodeComponent: React.FC<QRCodeComponentProps> = ({
const shareImageBase64 = { const shareImageBase64 = {
url: `data:image/png;base64,${data}`, url: `data:image/png;base64,${data}`,
}; };
Share.open(shareImageBase64).catch((error: any) => console.log(error)); Share.open(shareImageBase64).catch((error: Error) => console.log(error));
}); });
}; };

View file

@ -49,7 +49,7 @@ const TransactionsNavigationHeader: React.FC<TransactionsNavigationHeaderProps>
wallet wallet
.allowOnchainAddress() .allowOnchainAddress()
.then((value: boolean) => setAllowOnchainAddress(value)) .then((value: boolean) => setAllowOnchainAddress(value))
.catch((e: any) => { .catch((e: Error) => {
console.log('This Lndhub wallet does not have an onchain address API.'); console.log('This Lndhub wallet does not have an onchain address API.');
setAllowOnchainAddress(false); setAllowOnchainAddress(false);
}); });

View file

@ -22,7 +22,7 @@ function useAsyncPromise<T>(promiseFn: () => Promise<T>) {
setLoading(false); setLoading(false);
} }
}) })
.catch(err => { .catch((err: Error) => {
if (isMounted) { if (isMounted) {
setError(err); setError(err);
setLoading(false); setLoading(false);