Skip to content

Commit

Permalink
Merge pull request #644 from gabrielbazan7/ref/import-err
Browse files Browse the repository at this point in the history
[REF] handle wallet_does_not_exist err correctly
  • Loading branch information
JohnathanWhite authored Jan 23, 2023
2 parents 9ebd13c + 113f1f9 commit 69990b4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/store/wallet/effects/import/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,14 +785,22 @@ export const deferredImportErrorNotification =
(e?: any): Effect =>
async dispatch => {
dispatch(dismissOnGoingProcessModal());
await sleep(600);
await sleep(1000);
let errorStr = '';
if (e?.message === 'WALLET_DOES_NOT_EXIST') {
errorStr = t(
'There are no records of your wallet on our servers. If you are importing a BIP44 compatible wallet from a 3rd party you can continue to recreate it. If you wallet is not BIP44 compatible, you will not be able to access its funds.',
);
} else if (e) {
errorStr = e instanceof Error ? e.message : JSON.stringify(e);
}
dispatch(
showBottomNotificationModal({
type: 'error',
title: t('Problem importing key'),
message: `${t(
'There was an issue importing your key. Please try again.',
)}${e ? `\n\nError: ${e.message || e}` : ''}`,
)}${'\n\n'}${errorStr}`,
enableBackdropDismiss: false,
actions: [
{
Expand Down

0 comments on commit 69990b4

Please sign in to comment.