diff --git a/native/qr-code/qr-code-screen.react.js b/native/qr-code/qr-code-screen.react.js --- a/native/qr-code/qr-code-screen.react.js +++ b/native/qr-code/qr-code-screen.react.js @@ -41,14 +41,12 @@ function QRCodeScreen(props: QRCodeScreenProps): React.Node { const [qrData, setQRData] = React.useState(); - const { setUnauthorizedDeviceID } = useTunnelbroker(); const logInSecondaryDevice = useSecondaryDeviceLogIn(); const performRegistration = React.useCallback( async (userID: string) => { try { await logInSecondaryDevice(userID); - setUnauthorizedDeviceID(null); } catch (err) { console.error('Secondary device registration error:', err); Alert.alert('Registration failed', 'Failed to upload device keys', [ @@ -56,9 +54,10 @@ ]); } }, - [logInSecondaryDevice, setUnauthorizedDeviceID], + [logInSecondaryDevice], ); + const { setUnauthorizedDeviceID } = useTunnelbroker(); const generateQRCode = React.useCallback(async () => { try { const [ed25519, rawAESKey] = await Promise.all([ diff --git a/web/account/qr-code-login.react.js b/web/account/qr-code-login.react.js --- a/web/account/qr-code-login.react.js +++ b/web/account/qr-code-login.react.js @@ -65,21 +65,20 @@ function QRCodeLogin(): React.Node { const [qrData, setQRData] = React.useState(); - const { setUnauthorizedDeviceID } = useTunnelbroker(); const logInSecondaryDevice = useSecondaryDeviceLogIn(); const performRegistration = React.useCallback( async (userID: string) => { try { await logInSecondaryDevice(userID); - setUnauthorizedDeviceID(null); } catch (err) { console.error('Secondary device registration error:', err); } }, - [logInSecondaryDevice, setUnauthorizedDeviceID], + [logInSecondaryDevice], ); + const { setUnauthorizedDeviceID } = useTunnelbroker(); const generateQRCode = React.useCallback(async () => { try { const [ed25519, rawAESKey] = await Promise.all([