Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2894170
D8815.id29903.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D8815.id29903.diff
View Options
diff --git a/keyserver/src/responders/website-responders.js b/keyserver/src/responders/website-responders.js
--- a/keyserver/src/responders/website-responders.js
+++ b/keyserver/src/responders/website-responders.js
@@ -195,7 +195,6 @@
'default communityPickerStore',
_isEqual({ chat: null, calendar: null }),
),
- urlPrefix: t.String,
windowDimensions: t.irreducible(
'default windowDimensions',
_isEqual({ width: 0, height: 0 }),
@@ -587,7 +586,6 @@
loadingStatuses: {},
calendarFilters: defaultCalendarFilters,
communityPickerStore: { chat: null, calendar: null },
- urlPrefix,
windowDimensions: { width: 0, height: 0 },
notifPermissionAlertInfo: defaultNotifPermissionAlertInfo,
connection: (async () => ({
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
@@ -20,7 +20,6 @@
import reduceReportStore from './report-store-reducer.js';
import reduceServicesAccessToken from './services-access-token-reducer.js';
import { reduceThreadInfos } from './thread-reducer.js';
-import reduceURLPrefix from './url-prefix-reducer.js';
import { reduceCurrentUserInfo, reduceUserInfos } from './user-reducer.js';
import { siweAuthActionTypes } from '../actions/siwe-actions.js';
import {
@@ -122,7 +121,6 @@
threadStore,
userStore: reduceUserInfos(state.userStore, action),
messageStore,
- urlPrefix: reduceURLPrefix(state.urlPrefix, action),
calendarFilters: reduceCalendarFilters(
state.calendarFilters,
action,
@@ -148,7 +146,7 @@
lastCommunicatedPlatformDetails: reduceLastCommunicatedPlatformDetails(
state.lastCommunicatedPlatformDetails,
action,
- state.urlPrefix,
+ state.keyserverStore.keyserverInfos[ashoatKeyserverID].urlPrefix,
),
keyserverStore,
},
diff --git a/lib/reducers/url-prefix-reducer.js b/lib/reducers/url-prefix-reducer.js
deleted file mode 100644
--- a/lib/reducers/url-prefix-reducer.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// @flow
-
-import type { BaseAction } from '../types/redux-types.js';
-import { setURLPrefix } from '../utils/url-utils.js';
-
-export default function reduceURLPrefix(
- state: string,
- action: BaseAction,
-): string {
- if (action.type === setURLPrefix) {
- return action.payload;
- }
- return state;
-}
diff --git a/lib/selectors/keyserver-selectors.js b/lib/selectors/keyserver-selectors.js
--- a/lib/selectors/keyserver-selectors.js
+++ b/lib/selectors/keyserver-selectors.js
@@ -35,8 +35,7 @@
state.messageStore.currentAsOf[ashoatKeyserverID] ?? 0;
const urlPrefixSelector: (state: AppState) => ?string = (state: AppState) =>
- state.keyserverStore.keyserverInfos[ashoatKeyserverID]?.urlPrefix ??
- state.urlPrefix;
+ state.keyserverStore.keyserverInfos[ashoatKeyserverID]?.urlPrefix;
export {
cookieSelector,
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
@@ -126,7 +126,6 @@
+messageStore: MessageStore,
+loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } },
+calendarFilters: $ReadOnlyArray<CalendarFilter>,
- +urlPrefix: string,
+notifPermissionAlertInfo: NotifPermissionAlertInfo,
+connection: ConnectionInfo,
+watchedThreadIDs: $ReadOnlyArray<string>,
diff --git a/native/redux/persist.js b/native/redux/persist.js
--- a/native/redux/persist.js
+++ b/native/redux/persist.js
@@ -682,6 +682,23 @@
},
};
},
+ [47]: async state => {
+ const { urlPrefix, keyserverStore, ...rest } = state;
+
+ return {
+ ...rest,
+ keyserverStore: {
+ ...keyserverStore,
+ keyserverInfos: {
+ ...keyserverStore.keyserverInfos,
+ [ashoatKeyserverID]: {
+ ...keyserverStore.keyserverInfos[ashoatKeyserverID],
+ urlPrefix,
+ },
+ },
+ },
+ };
+ },
};
// After migration 31, we'll no longer want to persist `messageStore.messages`
@@ -776,7 +793,7 @@
'storeLoaded',
],
debug: __DEV__,
- version: 46,
+ version: 47,
transforms: [messageStoreMessagesBlocklistTransform, reportStoreTransform],
migrate: (createAsyncMigrate(migrations, { debug: __DEV__ }): any),
timeout: ((__DEV__ ? 0 : undefined): number | void),
diff --git a/native/redux/redux-setup.js b/native/redux/redux-setup.js
--- a/native/redux/redux-setup.js
+++ b/native/redux/redux-setup.js
@@ -92,7 +92,6 @@
calendarFilters: defaultCalendarFilters,
deviceToken: null,
dataLoaded: false,
- urlPrefix: defaultURLPrefix,
customServer: natNodeServer,
notifPermissionAlertInfo: defaultNotifPermissionAlertInfo,
connection: defaultConnectionInfo(Platform.OS),
diff --git a/native/redux/state-types.js b/native/redux/state-types.js
--- a/native/redux/state-types.js
+++ b/native/redux/state-types.js
@@ -39,7 +39,6 @@
+calendarFilters: $ReadOnlyArray<CalendarFilter>,
+deviceToken: ?string,
+dataLoaded: boolean,
- +urlPrefix: string,
+customServer: ?string,
+notifPermissionAlertInfo: NotifPermissionAlertInfo,
+connection: ConnectionInfo,
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -79,7 +79,6 @@
+loadingStatuses: { [key: string]: { [idx: number]: LoadingStatus } },
+calendarFilters: $ReadOnlyArray<CalendarFilter>,
+communityPickerStore: CommunityPickerStore,
- +urlPrefix: string,
+windowDimensions: WindowDimensions,
+deviceToken: ?string,
+notifPermissionAlertInfo: NotifPermissionAlertInfo,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 5, 3:04 PM (21 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2244227
Default Alt Text
D8815.id29903.diff (5 KB)
Attached To
Mode
D8815: [keyserver][lib][native][web] Remove urlPrefix from BaseAppState
Attached
Detach File
Event Timeline
Log In to Comment