diff --git a/lib/shared/notifications-session-creator-context.js b/lib/shared/olm-session-creator-context.js rename from lib/shared/notifications-session-creator-context.js rename to lib/shared/olm-session-creator-context.js --- a/lib/shared/notifications-session-creator-context.js +++ b/lib/shared/olm-session-creator-context.js @@ -5,7 +5,7 @@ import type { OLMIdentityKeys } from '../types/crypto-types.js'; import type { OlmSessionInitializationInfo } from '../types/request-types.js'; -export type NotificationsSessionCreatorContextType = { +export type OlmSessionCreatorContextType = { +notificationsSessionCreator: ( cookie: ?string, notificationsIdentityKeys: OLMIdentityKeys, @@ -14,7 +14,7 @@ ) => Promise, }; -const NotificationsSessionCreatorContext: React.Context = +const OlmSessionCreatorContext: React.Context = React.createContext(null); -export { NotificationsSessionCreatorContext }; +export { OlmSessionCreatorContext }; diff --git a/native/account/account-hooks.js b/native/account/account-hooks.js --- a/native/account/account-hooks.js +++ b/native/account/account-hooks.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import { NotificationsSessionCreatorContext } from 'lib/shared/notifications-session-creator-context.js'; +import { OlmSessionCreatorContext } from 'lib/shared/olm-session-creator-context.js'; import type { OLMIdentityKeys } from 'lib/types/crypto-types.js'; import type { OlmSessionInitializationInfo } from 'lib/types/request-types.js'; @@ -29,13 +29,13 @@ notificationsSessionCreator, }; -function NotificationsSessionCreatorProvider(props: Props): React.Node { +function OlmSessionCreatorProvider(props: Props): React.Node { const { children } = props; return ( - + {children} - + ); } -export { NotificationsSessionCreatorProvider }; +export { OlmSessionCreatorProvider }; diff --git a/native/root.react.js b/native/root.react.js --- a/native/root.react.js +++ b/native/root.react.js @@ -33,7 +33,7 @@ import { TunnelbrokerProvider } from 'lib/tunnelbroker/tunnelbroker-context.js'; import { actionLogger } from 'lib/utils/action-logger.js'; -import { NotificationsSessionCreatorProvider } from './account/account-hooks.js'; +import { OlmSessionCreatorProvider } from './account/account-hooks.js'; import { RegistrationContextProvider } from './account/registration/registration-context-provider.react.js'; import NativeEditThreadAvatarProvider from './avatars/native-edit-thread-avatar-provider.react.js'; import BackupHandler from './backup/backup-handler.js'; @@ -302,7 +302,7 @@ - + - + diff --git a/web/account/account-hooks.js b/web/account/account-hooks.js --- a/web/account/account-hooks.js +++ b/web/account/account-hooks.js @@ -11,7 +11,7 @@ getOneTimeKeyValuesFromBlob, getPrekeyValueFromBlob, } from 'lib/shared/crypto-utils.js'; -import { NotificationsSessionCreatorContext } from 'lib/shared/notifications-session-creator-context.js'; +import { OlmSessionCreatorContext } from 'lib/shared/olm-session-creator-context.js'; import type { SignedIdentityKeysBlob, CryptoStore, @@ -174,7 +174,7 @@ }, [getOrCreateCryptoStore]); } -function NotificationsSessionCreatorProvider(props: Props): React.Node { +function OlmSessionCreatorProvider(props: Props): React.Node { const getOrCreateCryptoStore = useGetOrCreateCryptoStore(); const currentCryptoStore = useSelector(state => state.cryptoStore); @@ -307,9 +307,9 @@ ); return ( - + {props.children} - + ); } @@ -319,7 +319,7 @@ notificationsInitializationInfo: OlmSessionInitializationInfo, keyserverID: string, ) => Promise { - const context = React.useContext(NotificationsSessionCreatorContext); + const context = React.useContext(OlmSessionCreatorContext); invariant(context, 'WebNotificationsSessionCreator not found.'); return context.notificationsSessionCreator; @@ -328,7 +328,7 @@ export { useGetSignedIdentityKeysBlob, useGetOrCreateCryptoStore, - NotificationsSessionCreatorProvider, + OlmSessionCreatorProvider, useWebNotificationsSessionCreator, GetOrCreateCryptoStoreProvider, }; diff --git a/web/root.js b/web/root.js --- a/web/root.js +++ b/web/root.js @@ -16,7 +16,7 @@ import { GetOrCreateCryptoStoreProvider, - NotificationsSessionCreatorProvider, + OlmSessionCreatorProvider, } from './account/account-hooks.js'; import App from './app.react.js'; import { SQLiteDataHandler } from './database/sqlite-data-handler.js'; @@ -47,14 +47,14 @@ - + - +