diff --git a/native/account/qr-auth/primary-device-qr-auth-context-provider.js b/native/account/qr-auth/primary-device-qr-auth-context-provider.js --- a/native/account/qr-auth/primary-device-qr-auth-context-provider.js +++ b/native/account/qr-auth/primary-device-qr-auth-context-provider.js @@ -62,6 +62,11 @@ const identityContext = React.useContext(IdentityClientContext); invariant(identityContext, 'identity context not set'); + const backupExists = useSelector( + state => !!state.backupStore.latestBackupInfo, + ); + const [backupNotReady, setBackupNotReady] = React.useState(false); + React.useEffect(() => { return () => { if (timeout.current) { @@ -258,11 +263,27 @@ return; } - await processDeviceListUpdate(); + if (backupExists) { + await processDeviceListUpdate(); + } else { + setBackupNotReady(true); + } }, - [processDeviceListUpdate], + [processDeviceListUpdate, backupExists], ); + React.useEffect(() => { + if (backupExists && backupNotReady && connectingInProgress) { + void processDeviceListUpdate(); + setBackupNotReady(false); + } + }, [ + backupExists, + backupNotReady, + connectingInProgress, + processDeviceListUpdate, + ]); + const onRemoveSecondaryDevice = React.useCallback(async () => { if (!secondaryDeviceID.current) { console.log('No secondary device to remove');