diff --git a/native/qr-code/qr-code-screen.react.js b/native/qr-code/qr-code-screen.react.js
index badd061b8..ab42dea61 100644
--- a/native/qr-code/qr-code-screen.react.js
+++ b/native/qr-code/qr-code-screen.react.js
@@ -1,108 +1,107 @@
// @flow
import * as React from 'react';
import { View, Text } from 'react-native';
import QRCode from 'react-native-qrcode-svg';
import { useQRAuthContext } from 'lib/components/qr-auth-provider.react.js';
import { qrCodeLinkURL } from 'lib/facts/links.js';
import { platformToIdentityDeviceType } from 'lib/types/identity-service-types.js';
import { getConfig } from 'lib/utils/config.js';
import type { QRCodeSignInNavigationProp } from './qr-code-sign-in-navigator.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
import { useStyles } from '../themes/colors.js';
type QRCodeScreenProps = {
+navigation: QRCodeSignInNavigationProp<'QRCodeScreen'>,
+route: NavigationRoute<'QRCodeScreen'>,
};
-const { platform } = getConfig().platformDetails;
-
// eslint-disable-next-line no-unused-vars
function QRCodeScreen(props: QRCodeScreenProps): React.Node {
const { qrData, generateQRCode } = useQRAuthContext();
React.useEffect(() => {
void generateQRCode();
}, [generateQRCode]);
+ const { platform } = getConfig().platformDetails;
const qrCodeURL = React.useMemo(() => {
if (!qrData) {
return undefined;
}
const deviceType = platformToIdentityDeviceType[platform];
return qrCodeLinkURL(qrData.aesKey, qrData.deviceID, deviceType);
- }, [qrData]);
+ }, [platform, qrData]);
const styles = useStyles(unboundStyles);
return (
Log in to Comm
Open the Comm app on your phone and scan the QR code below
How to find the scanner:
Go to
Profile
Select
Linked devices
Click
Add
on the top right
);
}
const unboundStyles = {
container: {
flex: 1,
alignItems: 'center',
marginTop: 125,
},
heading: {
fontSize: 24,
color: 'panelForegroundLabel',
paddingBottom: 12,
},
headingSubtext: {
fontSize: 12,
color: 'panelForegroundLabel',
paddingBottom: 30,
},
instructionsBox: {
alignItems: 'center',
width: 300,
marginTop: 40,
padding: 15,
borderColor: 'panelForegroundLabel',
borderWidth: 2,
borderRadius: 8,
},
instructionsTitle: {
fontSize: 12,
color: 'panelForegroundLabel',
paddingBottom: 15,
},
instructionsStep: {
fontSize: 12,
padding: 1,
color: 'panelForegroundLabel',
},
instructionsBold: {
fontWeight: 'bold',
},
};
export default QRCodeScreen;
diff --git a/web/account/qr-code-login.react.js b/web/account/qr-code-login.react.js
index 524752878..d6303482f 100644
--- a/web/account/qr-code-login.react.js
+++ b/web/account/qr-code-login.react.js
@@ -1,55 +1,54 @@
// @flow
import { QRCodeSVG } from 'qrcode.react';
import * as React from 'react';
import { useQRAuthContext } from 'lib/components/qr-auth-provider.react.js';
import { qrCodeLinkURL } from 'lib/facts/links.js';
import { platformToIdentityDeviceType } from 'lib/types/identity-service-types.js';
import { getConfig } from 'lib/utils/config.js';
import css from './qr-code-login.css';
-const { platform } = getConfig().platformDetails;
-
function QRCodeLogin(): React.Node {
const { qrData, generateQRCode } = useQRAuthContext();
React.useEffect(() => {
void generateQRCode();
}, [generateQRCode]);
+ const { platform } = getConfig().platformDetails;
const qrCodeURL = React.useMemo(() => {
if (!qrData) {
return undefined;
}
const identityDeviceType = platformToIdentityDeviceType[platform];
return qrCodeLinkURL(qrData.aesKey, qrData.deviceID, identityDeviceType);
- }, [qrData]);
+ }, [platform, qrData]);
return (
Log in to Comm
Open the Comm app on your phone and scan the QR code below
How to find the scanner:
Go to Profile
Select Linked devices
Click Add on the top right
);
}
export default QRCodeLogin;