diff --git a/web/selectors/socket-selectors.js b/web/selectors/socket-selectors.js --- a/web/selectors/socket-selectors.js +++ b/web/selectors/socket-selectors.js @@ -37,9 +37,9 @@ (sessionID: ?string): SessionIdentification => ({ sessionID }), ); -const getSignedIdentityKeysBlobSelector: ( +const signedIdentityKeysBlobSelector: ( state: AppState, -) => ?() => Promise = createSelector( +) => ?SignedIdentityKeysBlob = createSelector( (state: AppState) => state.cryptoStore.primaryAccount, (state: AppState) => state.cryptoStore.primaryIdentityKeys, (state: AppState) => state.cryptoStore.notificationIdentityKeys, @@ -68,6 +68,18 @@ signature: primaryOLMAccount.sign(payloadToBeSigned), }; + return signedIdentityKeysBlob; + }, +); + +const getSignedIdentityKeysBlobSelector: ( + state: AppState, +) => ?() => Promise = createSelector( + signedIdentityKeysBlobSelector, + (signedIdentityKeysBlob: ?SignedIdentityKeysBlob) => { + if (!signedIdentityKeysBlob) { + return null; + } return async () => signedIdentityKeysBlob; }, );