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 @@ -204,13 +204,13 @@ }, [identityClient]); } -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, ): (( @@ -703,8 +703,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 @@ -16,8 +16,8 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, tempIdentityLoginActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -59,7 +59,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 { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import { defaultCalendarQuery } 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 @@ -6,7 +6,7 @@ import { keyserverAuthActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import type { ThreadStoreOperation } from '../ops/thread-store-ops'; import type { IntegrityStore } from '../types/integrity-types'; @@ -24,7 +24,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 @@ -15,7 +15,7 @@ keyserverAuthActionTypes, logOutActionTypes, deleteKeyserverAccountActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, logInActionTypes, resetUserStateActionType, } from '../actions/user-actions.js'; @@ -209,7 +209,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 @@ -52,7 +52,7 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import { @@ -893,7 +893,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,8 +6,8 @@ logOutActionTypes, deleteKeyserverAccountActionTypes, logInActionTypes, - registerActionTypes, tempIdentityLoginActionTypes, + keyserverRegisterActionTypes, } from '../actions/user-actions.js'; import { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; import type { BaseAction } from '../types/redux-types.js'; @@ -23,8 +23,8 @@ if ( action.type === logInActionTypes.success || action.type === siweAuthActionTypes.success || - action.type === registerActionTypes.success || - action.type === tempIdentityLoginActionTypes.success + action.type === tempIdentityLoginActionTypes.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 { setNewSessionActionType } from '../keyserver-conn/keyserver-conn-types.js'; @@ -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 @@ -359,18 +359,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 { @@ -305,7 +305,7 @@ const initialNotificationsEncryptedMessage = await this.props.getInitialNotificationsEncryptedMessage(); void this.props.dispatchActionPromise( - registerActionTypes, + keyserverRegisterActionTypes, this.registerAction({ ...extraInfo, initialNotificationsEncryptedMessage, @@ -460,8 +460,9 @@ }, }); -const registerLoadingStatusSelector = - createLoadingStatusSelector(registerActionTypes); +const registerLoadingStatusSelector = createLoadingStatusSelector( + keyserverRegisterActionTypes, +); const olmSessionInitializationDataLoadingStatusSelector = createLoadingStatusSelector(getOlmSessionInitializationDataActionTypes); @@ -480,7 +481,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 } from 'lib/utils/action-utils.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -56,7 +59,7 @@ const logInExtraInfo = useSelector(nativeLogInExtraInfoSelector); const dispatchActionPromise = useDispatchActionPromise(); - const callRegister = useServerCall(register); + const callRegister = useServerCall(keyserverRegister); const registerUsernameAccount = React.useCallback( async ( @@ -105,7 +108,7 @@ } })(); void dispatchActionPromise( - registerActionTypes, + keyserverRegisterActionTypes, registerPromise, undefined, ({ calendarQuery: extraInfo.calendarQuery }: LogInStartingPayload),