`);
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,
_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/types/redux-types.js b/lib/types/redux-types.js
index bc109406d..253b03c0e 100644
--- a/lib/types/redux-types.js
+++ b/lib/types/redux-types.js
@@ -1,839 +1,852 @@
// @flow
import type { Shape } from '../types/core';
import type {
LogOutResult,
LogInStartingPayload,
LogInResult,
RegisterResult,
DefaultNotificationPayload,
} from './account-types';
import type {
ActivityUpdateSuccessPayload,
QueueActivityUpdatesPayload,
SetThreadUnreadStatusPayload,
} from './activity-types';
+import type { DraftStore } from './draft-types';
import type { EnabledApps, SupportedApps } from './enabled-apps';
import type {
RawEntryInfo,
EntryStore,
SaveEntryPayload,
CreateEntryPayload,
DeleteEntryResult,
RestoreEntryPayload,
FetchEntryInfosResult,
CalendarQueryUpdateResult,
CalendarQueryUpdateStartingPayload,
} from './entry-types';
import type {
CalendarFilter,
CalendarThreadFilter,
SetCalendarDeletedFilterPayload,
} from './filter-types';
import type { LifecycleState } from './lifecycle-state-types';
import type { LoadingStatus, LoadingInfo } from './loading-types';
import type { UpdateMultimediaMessageMediaPayload } from './media-types';
import type { MessageReportCreationResult } from './message-report-types';
import type {
MessageStore,
RawMultimediaMessageInfo,
FetchMessageInfosPayload,
SendMessagePayload,
SaveMessagesPayload,
NewMessagesPayload,
MessageStorePrunePayload,
LocallyComposedMessageInfo,
ClientDBMessageInfo,
SimpleMessagesPayload,
} from './message-types';
import type { RawTextMessageInfo } from './messages/text';
import type { BaseNavInfo } from './nav-types';
import type { RelationshipErrors } from './relationship-types';
import type {
EnabledReports,
ClearDeliveredReportsPayload,
QueueReportsPayload,
ReportStore,
} from './report-types';
import type { ProcessServerRequestsPayload } from './request-types';
import type { UserSearchResult } from './search-types';
import type { SetSessionPayload } from './session-types';
import type {
ConnectionInfo,
StateSyncFullActionPayload,
StateSyncIncrementalActionPayload,
UpdateConnectionStatusPayload,
SetLateResponsePayload,
UpdateDisconnectedBarPayload,
} from './socket-types';
import type { SubscriptionUpdateResult } from './subscription-types';
import type {
ThreadStore,
ChangeThreadSettingsPayload,
LeaveThreadPayload,
NewThreadResult,
ThreadJoinPayload,
} from './thread-types';
import type { ClientUpdatesResultWithUserInfos } from './update-types';
import type { CurrentUserInfo, UserStore } from './user-types';
export type BaseAppState