diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -182,13 +182,13 @@ return deleteIdentityAccount; } -const registerActionTypes = Object.freeze({ - started: 'REGISTER_STARTED', - success: 'REGISTER_SUCCESS', - failed: 'REGISTER_FAILED', +const keyserverRegisterActionTypes = Object.freeze({ + started: 'KEYSERVER_REGISTER_STARTED', + success: 'KEYSERVER_REGISTER_SUCCESS', + failed: 'KEYSERVER_REGISTER_FAILED', }); const registerCallServerEndpointOptions = { timeout: 60000 }; -const register = +const keyserverRegister = ( callServerEndpoint: CallServerEndpoint, ): (( @@ -543,8 +543,8 @@ logInActionTypes, useLogOut, logOutActionTypes, - register, - registerActionTypes, + keyserverRegister, + keyserverRegisterActionTypes, searchUsers, searchUsersActionTypes, exactSearchUser, diff --git a/lib/reducers/calendar-filters-reducer.js b/lib/reducers/calendar-filters-reducer.js --- a/lib/reducers/calendar-filters-reducer.js +++ b/lib/reducers/calendar-filters-reducer.js @@ -15,7 +15,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { filteredThreadIDs, @@ -55,7 +55,7 @@ action.type === deleteKeyserverAccountActionTypes.success || action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || (action.type === setNewSessionActionType && action.payload.sessionChange.cookieInvalidated) ) { diff --git a/lib/reducers/calendar-query-reducer.js b/lib/reducers/calendar-query-reducer.js --- a/lib/reducers/calendar-query-reducer.js +++ b/lib/reducers/calendar-query-reducer.js @@ -6,7 +6,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { defaultCalendarQuery } from '../types/entry-types.js'; import type { CalendarQuery } from '../types/entry-types.js'; @@ -35,7 +35,7 @@ ) { return action.payload.calendarResult.calendarQuery; } else if ( - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || action.type === updateCalendarQueryActionTypes.success || action.type === fullStateSyncActionType || action.type === incrementalStateSyncActionType diff --git a/lib/reducers/integrity-reducer.js b/lib/reducers/integrity-reducer.js --- a/lib/reducers/integrity-reducer.js +++ b/lib/reducers/integrity-reducer.js @@ -5,7 +5,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import type { ThreadStoreOperation } from '../ops/thread-store-ops'; import type { IntegrityStore } from '../types/integrity-types'; @@ -23,7 +23,7 @@ if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || action.type === fullStateSyncActionType || (action.type === setClientDBStoreActionType && !!action.payload.threadStore && diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js --- a/lib/reducers/keyserver-reducer.js +++ b/lib/reducers/keyserver-reducer.js @@ -14,7 +14,7 @@ import { logOutActionTypes, deleteKeyserverAccountActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, logInActionTypes, resetUserStateActionType, } from '../actions/user-actions.js'; @@ -198,7 +198,7 @@ }, }, }; - } else if (action.type === registerActionTypes.success) { + } else if (action.type === keyserverRegisterActionTypes.success) { state = { ...state, keyserverInfos: { diff --git a/lib/reducers/master-reducer.js b/lib/reducers/master-reducer.js --- a/lib/reducers/master-reducer.js +++ b/lib/reducers/master-reducer.js @@ -26,7 +26,7 @@ import { addKeyserverActionType } from '../actions/keyserver-actions.js'; import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { - registerActionTypes, + keyserverRegisterActionTypes, logInActionTypes, } from '../actions/user-actions.js'; import { isStaff } from '../shared/staff-utils.js'; @@ -82,7 +82,7 @@ if ( action.type !== incrementalStateSyncActionType && action.type !== fullStateSyncActionType && - action.type !== registerActionTypes.success && + action.type !== keyserverRegisterActionTypes.success && action.type !== logInActionTypes.success && action.type !== siweAuthActionTypes.success && action.type !== addKeyserverActionType diff --git a/lib/reducers/message-reducer.js b/lib/reducers/message-reducer.js --- a/lib/reducers/message-reducer.js +++ b/lib/reducers/message-reducer.js @@ -50,7 +50,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { messageStoreOpsHandlers, @@ -865,7 +865,7 @@ }, newThreadInfos, ); - } else if (action.type === registerActionTypes.success) { + } else if (action.type === keyserverRegisterActionTypes.success) { const truncationStatuses: { [string]: MessageTruncationStatus } = {}; for (const messageInfo of action.payload.rawMessageInfos) { truncationStatuses[messageInfo.threadID] = diff --git a/lib/reducers/nav-reducer.js b/lib/reducers/nav-reducer.js --- a/lib/reducers/nav-reducer.js +++ b/lib/reducers/nav-reducer.js @@ -4,7 +4,7 @@ import { siweAuthActionTypes } from '../actions/siwe-actions.js'; import { logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import type { BaseNavInfo } from '../types/nav-types.js'; import type { BaseAction } from '../types/redux-types.js'; @@ -20,7 +20,7 @@ if ( action.type === logInActionTypes.started || action.type === siweAuthActionTypes.started || - action.type === registerActionTypes.started || + action.type === keyserverRegisterActionTypes.started || action.type === fullStateSyncActionType || action.type === incrementalStateSyncActionType ) { diff --git a/lib/reducers/theme-reducer.js b/lib/reducers/theme-reducer.js --- a/lib/reducers/theme-reducer.js +++ b/lib/reducers/theme-reducer.js @@ -6,7 +6,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import type { BaseAction } from '../types/redux-types.js'; import { @@ -22,7 +22,7 @@ if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success + action.type === keyserverRegisterActionTypes.success ) { return defaultGlobalThemeInfo; } else if ( diff --git a/lib/reducers/thread-reducer.js b/lib/reducers/thread-reducer.js --- a/lib/reducers/thread-reducer.js +++ b/lib/reducers/thread-reducer.js @@ -22,7 +22,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, updateSubscriptionActionTypes, } from '../actions/user-actions.js'; import { @@ -84,7 +84,7 @@ if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || action.type === fullStateSyncActionType ) { const newThreadInfos = action.payload.threadInfos; diff --git a/lib/reducers/user-reducer.js b/lib/reducers/user-reducer.js --- a/lib/reducers/user-reducer.js +++ b/lib/reducers/user-reducer.js @@ -13,7 +13,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, setUserSettingsActionTypes, updateUserAvatarActionTypes, resetUserStateActionType, @@ -54,7 +54,7 @@ if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || action.type === logOutActionTypes.success || action.type === deleteKeyserverAccountActionTypes.success ) { @@ -242,7 +242,7 @@ } else if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || action.type === fullStateSyncActionType ) { const newUserInfos = _keyBy(userInfo => userInfo.id)( @@ -265,7 +265,7 @@ if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || + action.type === keyserverRegisterActionTypes.success || !_isEqual(state.userInfos)(newUserInfos) ) { return [ diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -325,18 +325,18 @@ +loadingInfo: LoadingInfo, } | { - +type: 'REGISTER_STARTED', + +type: 'KEYSERVER_REGISTER_STARTED', +loadingInfo: LoadingInfo, +payload: LogInStartingPayload, } | { - +type: 'REGISTER_FAILED', + +type: 'KEYSERVER_REGISTER_FAILED', +error: true, +payload: Error, +loadingInfo: LoadingInfo, } | { - +type: 'REGISTER_SUCCESS', + +type: 'KEYSERVER_REGISTER_SUCCESS', +payload: RegisterResult, +loadingInfo: LoadingInfo, } diff --git a/native/account/register-panel.react.js b/native/account/register-panel.react.js --- a/native/account/register-panel.react.js +++ b/native/account/register-panel.react.js @@ -14,8 +14,8 @@ import { setDataLoadedActionType } from 'lib/actions/client-db-store-actions.js'; import { - registerActionTypes, - register, + keyserverRegisterActionTypes, + keyserverRegister, getOlmSessionInitializationDataActionTypes, } from 'lib/actions/user-actions.js'; import { @@ -308,7 +308,7 @@ const initialNotificationsEncryptedMessage = await this.props.getInitialNotificationsEncryptedMessage(); void this.props.dispatchActionPromise( - registerActionTypes, + keyserverRegisterActionTypes, this.registerAction({ ...extraInfo, initialNotificationsEncryptedMessage, @@ -463,8 +463,9 @@ }, }); -const registerLoadingStatusSelector = - createLoadingStatusSelector(registerActionTypes); +const registerLoadingStatusSelector = createLoadingStatusSelector( + keyserverRegisterActionTypes, +); const olmSessionInitializationDataLoadingStatusSelector = createLoadingStatusSelector(getOlmSessionInitializationDataActionTypes); @@ -489,7 +490,7 @@ const dispatch = useDispatch(); const dispatchActionPromise = useDispatchActionPromise(); - const callRegister = useServerCall(register); + const callRegister = useServerCall(keyserverRegister); const getInitialNotificationsEncryptedMessage = useInitialNotificationsEncryptedMessage( nativeNotificationsSessionCreator, diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js --- a/native/account/registration/registration-server-call.js +++ b/native/account/registration/registration-server-call.js @@ -3,7 +3,10 @@ import * as React from 'react'; import { setDataLoadedActionType } from 'lib/actions/client-db-store-actions.js'; -import { registerActionTypes, register } from 'lib/actions/user-actions.js'; +import { + keyserverRegisterActionTypes, + keyserverRegister, +} from 'lib/actions/user-actions.js'; import type { LogInStartingPayload } from 'lib/types/account-types.js'; import { useServerCall, @@ -65,7 +68,7 @@ ); const dispatchActionPromise = useDispatchActionPromise(); - const callRegister = useServerCall(register); + const callRegister = useServerCall(keyserverRegister); const registerUsernameAccount = React.useCallback( async ( @@ -114,7 +117,7 @@ } })(); void dispatchActionPromise( - registerActionTypes, + keyserverRegisterActionTypes, registerPromise, undefined, ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),