`);
const statePromises = {
navInfo: navInfoPromise,
deviceID: null,
currentUserInfo: ((currentUserInfoPromise: any): Promise
),
draftStore: { drafts: {} },
sessionID: sessionIDPromise,
entryStore: entryStorePromise,
threadStore: threadStorePromise,
userStore: userStorePromise,
messageStore: messageStorePromise,
updatesCurrentAsOf: initialTime,
loadingStatuses: {},
calendarFilters: defaultCalendarFilters,
// We can use paths local to the on web
urlPrefix: '',
windowDimensions: { width: 0, height: 0 },
baseHref,
connection: {
...defaultConnectionInfo('web', viewer.timeZone),
actualizedCalendarQuery: calendarQuery,
},
watchedThreadIDs: [],
lifecycleState: 'active',
enabledApps: defaultWebEnabledApps,
reportStore: {
enabledReports: defaultEnabledReports,
queuedReports: [],
},
nextLocalID: 0,
timeZone: viewer.timeZone,
userAgent: viewer.userAgent,
cookie: undefined,
deviceToken: undefined,
dataLoaded: viewer.loggedIn,
windowActive: true,
+ userPolicies: {},
_persist: null,
};
const [stateResult, App] = await Promise.all([
promiseAll(statePromises),
appPromise,
]);
const state: AppState = { ...stateResult };
const store: Store = createStore(reducer, state);
const routerContext = {};
const clientPath = clientPathFromRouterPath(req.url, appURLFacts);
const reactStream = renderToNodeStream(
,
);
if (routerContext.url) {
throw new ServerError('URL modified during server render!');
}
reactStream.pipe(res, { end: false });
await waitForStream(reactStream);
res.write(html`
`);
}
export { websiteResponder };
diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js
index 01d69e9d4..5e2acf464 100644
--- a/lib/actions/user-actions.js
+++ b/lib/actions/user-actions.js
@@ -1,243 +1,259 @@
// @flow
import threadWatcher from '../shared/thread-watcher';
import type {
LogOutResult,
LogInInfo,
LogInResult,
RegisterResult,
RegisterInfo,
UpdateUserSettingsRequest,
+ PolicyAcknowledgmentRequest,
} from '../types/account-types';
import type { GetSessionPublicKeysArgs } from '../types/request-types';
import type { UserSearchResult } from '../types/search-types';
import type {
SessionPublicKeys,
PreRequestUserState,
} from '../types/session-types';
import type {
SubscriptionUpdateRequest,
SubscriptionUpdateResult,
} from '../types/subscription-types';
import type { UserInfo, PasswordUpdate } from '../types/user-types';
import type { CallServerEndpoint } from '../utils/call-server-endpoint';
import { getConfig } from '../utils/config';
import sleep from '../utils/sleep';
const logOutActionTypes = Object.freeze({
started: 'LOG_OUT_STARTED',
success: 'LOG_OUT_SUCCESS',
failed: 'LOG_OUT_FAILED',
});
const logOut = (
callServerEndpoint: CallServerEndpoint,
): ((
preRequestUserState: PreRequestUserState,
) => Promise