Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32373327
D9550.1765327100.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D9550.1765327100.diff
View Options
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
@@ -19,6 +19,7 @@
import policiesReducer from './policies-reducer.js';
import reduceReportStore from './report-store-reducer.js';
import reduceServicesAccessToken from './services-access-token-reducer.js';
+import reduceGlobalThemeInfo from './theme-reducer.js';
import { reduceThreadActivity } from './thread-activity-reducer.js';
import { reduceThreadInfos } from './thread-reducer.js';
import { reduceCurrentUserInfo, reduceUserInfos } from './user-reducer.js';
@@ -163,6 +164,7 @@
threadStore.threadInfos,
threadStoreOperations,
),
+ globalThemeInfo: reduceGlobalThemeInfo(state.globalThemeInfo, action),
},
storeOperations: {
draftStoreOperations,
diff --git a/native/redux/theme-reducer.js b/lib/reducers/theme-reducer.js
rename from native/redux/theme-reducer.js
rename to lib/reducers/theme-reducer.js
--- a/native/redux/theme-reducer.js
+++ b/lib/reducers/theme-reducer.js
@@ -1,24 +1,23 @@
// @flow
-import { siweAuthActionTypes } from 'lib/actions/siwe-actions.js';
-import { updateThemeInfoActionType } from 'lib/actions/theme-actions.js';
+import { siweAuthActionTypes } from '../actions/siwe-actions.js';
+import { updateThemeInfoActionType } from '../actions/theme-actions.js';
import {
logOutActionTypes,
deleteAccountActionTypes,
logInActionTypes,
registerActionTypes,
-} from 'lib/actions/user-actions.js';
+} from '../actions/user-actions.js';
+import type { BaseAction } from '../types/redux-types.js';
import {
defaultGlobalThemeInfo,
type GlobalThemeInfo,
-} from 'lib/types/theme-types.js';
-import { setNewSessionActionType } from 'lib/utils/action-utils.js';
-
-import type { Action } from './action-types.js';
+} from '../types/theme-types.js';
+import { setNewSessionActionType } from '../utils/action-utils.js';
export default function reduceGlobalThemeInfo(
state: GlobalThemeInfo,
- action: Action,
+ action: BaseAction,
): GlobalThemeInfo {
if (
action.type === logInActionTypes.success ||
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
@@ -142,6 +142,7 @@
+keyserverStore: KeyserverStore,
+threadActivityStore: ThreadActivityStore,
+integrityStore: IntegrityStore,
+ +globalThemeInfo: GlobalThemeInfo,
...
};
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
@@ -7,7 +7,6 @@
import { setClientDBStoreActionType } from 'lib/actions/client-db-store-actions.js';
import { siweAuthActionTypes } from 'lib/actions/siwe-actions.js';
-import { updateThemeInfoActionType } from 'lib/actions/theme-actions.js';
import {
logOutActionTypes,
deleteAccountActionTypes,
@@ -43,7 +42,6 @@
import { persistConfig, setPersistor } from './persist.js';
import { processDBStoreOperations } from './redux-utils.js';
import type { AppState } from './state-types.js';
-import reduceGlobalThemeInfo from './theme-reducer.js';
import { getGlobalNavContext } from '../navigation/icky-global.js';
import { activeMessageListSelector } from '../navigation/nav-selectors.js';
import reactotron from '../reactotron.js';
@@ -143,11 +141,6 @@
return state;
}
- state = {
- ...state,
- globalThemeInfo: reduceGlobalThemeInfo(state.globalThemeInfo, action),
- };
-
if (action.type === setCustomServer) {
return {
...state,
@@ -166,9 +159,6 @@
...state,
connectivity: action.payload,
};
- } else if (action.type === updateThemeInfoActionType) {
- // Handled above by reduceGlobalThemeInfo
- return state;
} else if (action.type === updateDeviceCameraInfoActionType) {
return {
...state,
diff --git a/web/redux/default-state.js b/web/redux/default-state.js
--- a/web/redux/default-state.js
+++ b/web/redux/default-state.js
@@ -3,6 +3,7 @@
import { defaultEnabledApps } from 'lib/types/enabled-apps.js';
import { defaultCalendarFilters } from 'lib/types/filter-types.js';
import { defaultConnectionInfo } from 'lib/types/socket-types.js';
+import { defaultGlobalThemeInfo } from 'lib/types/theme-types.js';
import { isDev } from 'lib/utils/dev-utils.js';
import { defaultNotifPermissionAlertInfo } from 'lib/utils/push-alerts.js';
import { ashoatKeyserverID } from 'lib/utils/validation-utils.js';
@@ -90,6 +91,7 @@
threadActivityStore: {},
initialStateLoaded: false,
integrityStore: { threadHashes: {}, threadHashingStatus: 'starting' },
+ globalThemeInfo: defaultGlobalThemeInfo,
});
export { defaultWebState };
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
@@ -31,6 +31,7 @@
import type { UserPolicies } from 'lib/types/policy-types.js';
import type { BaseAction } from 'lib/types/redux-types.js';
import type { ReportStore } from 'lib/types/report-types.js';
+import type { GlobalThemeInfo } from 'lib/types/theme-types.js';
import type { ThreadActivityStore } from 'lib/types/thread-activity-types';
import type { ThreadStore } from 'lib/types/thread-types.js';
import type { CurrentUserInfo, UserStore } from 'lib/types/user-types.js';
@@ -102,6 +103,7 @@
+threadActivityStore: ThreadActivityStore,
+initialStateLoaded: boolean,
+integrityStore: IntegrityStore,
+ +globalThemeInfo: GlobalThemeInfo,
};
export type Action =
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 12:38 AM (10 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5851501
Default Alt Text
D9550.1765327100.diff (5 KB)
Attached To
Mode
D9550: [lib/native/web] lift globalThemeInfo redux state into lib
Attached
Detach File
Event Timeline
Log In to Comment