Skip to content

Commit ea2df7c

Browse files
authored
fix: handle address already uploaded (#1926)
1 parent 5490a77 commit ea2df7c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/providers/TurnkeyAuthProvider.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ const useTurnkeyAuthContext = () => {
456456
return response;
457457
},
458458
onError: (error, variables) => {
459-
dispatch(setRequiresAddressUpload(true));
460459
track(
461460
AnalyticsEvents.UploadAddressError({
462461
dydxAddress: variables.payload.dydxAddress,
@@ -490,7 +489,11 @@ const useTurnkeyAuthContext = () => {
490489
dispatch(setRequiresAddressUpload(true));
491490
}
492491
} catch (error) {
493-
logBonsaiError('TurnkeyOnboarding', 'Error uploading address', { error });
492+
if ((error.message ?? '').includes('Dydx address already uploaded')) {
493+
dispatch(setRequiresAddressUpload(false));
494+
} else {
495+
logBonsaiError('TurnkeyOnboarding', 'Error uploading address', { error });
496+
}
494497
}
495498
},
496499
[dispatch, dydxAddress, getUploadAddressPayload, sendUploadAddressRequest]

0 commit comments

Comments
 (0)