Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3490603
D6094.id20333.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6094.id20333.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
@@ -8,6 +8,7 @@
import ReactDOMServer from 'react-dom/server';
import { promisify } from 'util';
+import { baseLegalPolicies } from 'lib/facts/policies.js';
import { daysToEntriesFromEntryInfos } from 'lib/reducers/entry-reducer';
import { freshMessageStore } from 'lib/reducers/message-reducer';
import { mostRecentlyReadThread } from 'lib/selectors/thread-selectors';
@@ -32,6 +33,7 @@
import { fetchEntryInfos } from '../fetchers/entry-fetchers';
import { fetchMessageInfos } from '../fetchers/message-fetchers';
+import { fetchNotAcknowledgedPolicies } from '../fetchers/policy-acknowledgment-fetchers.js';
import { fetchThreadInfos } from '../fetchers/thread-fetchers';
import {
fetchCurrentUserInfo,
@@ -308,17 +310,41 @@
var preloadedState =
`);
+ const notAcknowledgedPolicies = await fetchNotAcknowledgedPolicies(
+ viewer,
+ baseLegalPolicies,
+ );
+ const policiesAccepted = !notAcknowledgedPolicies.length;
+
const initialReduxState = await promiseAll({
navInfo: navInfoPromise,
deviceID: null,
currentUserInfo: currentUserInfoPromise,
draftStore: { drafts: {} },
sessionID: sessionIDPromise,
- entryStore: entryStorePromise,
- threadStore: threadStorePromise,
- userStore: userStorePromise,
- messageStore: messageStorePromise,
- updatesCurrentAsOf: initialTime,
+ entryStore: policiesAccepted
+ ? entryStorePromise
+ : {
+ entryInfos: {},
+ daysToEntries: {},
+ lastUserInteractionCalendar: 0,
+ },
+ threadStore: policiesAccepted ? threadStorePromise : { threadInfos: {} },
+ userStore: policiesAccepted
+ ? userStorePromise
+ : {
+ userInfos: {},
+ inconsistencyReports: [],
+ },
+ messageStore: policiesAccepted
+ ? messageStorePromise
+ : {
+ messages: {},
+ threads: {},
+ local: {},
+ currentAsOf: 0,
+ },
+ updatesCurrentAsOf: policiesAccepted ? initialTime : 0,
loadingStatuses: {},
calendarFilters: defaultCalendarFilters,
// We can use paths local to the <base href> on web
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 4:54 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2678051
Default Alt Text
D6094.id20333.diff (2 KB)
Attached To
Mode
D6094: [keyserver] disable injecting redux state when policies are not accepted
Attached
Detach File
Event Timeline
Log In to Comment