Page MenuHomePhabricator

D10370.diff
No OneTemporary

D10370.diff

diff --git a/native/utils/tunnelbroker-utils.js b/native/utils/tunnelbroker-utils.js
--- a/native/utils/tunnelbroker-utils.js
+++ b/native/utils/tunnelbroker-utils.js
@@ -4,20 +4,22 @@
import type { ConnectionInitializationMessage } from 'lib/types/tunnelbroker/session-types.js';
-import { getContentSigningKey } from './crypto-utils.js';
+import { commCoreModule } from '../native-modules.js';
import { useSelector } from '../redux/redux-utils.js';
function useTunnelbrokerInitMessage(): ?ConnectionInitializationMessage {
const [deviceID, setDeviceID] = React.useState<?string>();
- const userID = useSelector(state => state.currentUserInfo?.id);
+ const [userID, setUserID] = React.useState<?string>();
const accessToken = useSelector(state => state.commServicesAccessToken);
React.useEffect(() => {
void (async () => {
- const contentSigningKey = await getContentSigningKey();
+ const { userID: identityUserID, deviceID: contentSigningKey } =
+ await commCoreModule.getCommServicesAuthMetadata();
setDeviceID(contentSigningKey);
+ setUserID(identityUserID);
})();
- }, []);
+ }, [accessToken]);
return React.useMemo(() => {
if (!deviceID || !accessToken || !userID) {

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 11:55 PM (20 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2602848
Default Alt Text
D10370.diff (1 KB)

Event Timeline