Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33197362
D12115.1768541798.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D12115.1768541798.diff
View Options
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<?{ +deviceID: string, +aesKey: string }>();
- 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<?{ +deviceID: string, +aesKey: string }>();
- 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([
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 5:36 AM (1 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5942167
Default Alt Text
D12115.1768541798.diff (2 KB)
Attached To
Mode
D12115: [native][web] Avoid clearing unauthorizedDeviceID twice
Attached
Detach File
Event Timeline
Log In to Comment