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 @@ -310,6 +310,7 @@ navInfo: navInfoPromise, deviceID: null, currentUserInfo: ((currentUserInfoPromise: any): Promise), + draftStore: { drafts: {} }, sessionID: sessionIDPromise, entryStore: entryStorePromise, threadStore: threadStorePromise, 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 @@ -13,6 +13,7 @@ QueueActivityUpdatesPayload, SetThreadUnreadStatusPayload, } from './activity-types'; +import type { DraftStore } from './draft-types'; import type { EnabledApps, SupportedApps } from './enabled-apps'; import type { RawEntryInfo, @@ -80,6 +81,7 @@ export type BaseAppState = { navInfo: NavInfo, currentUserInfo: ?CurrentUserInfo, + draftStore: DraftStore, entryStore: EntryStore, threadStore: ThreadStore, userStore: UserStore, @@ -537,12 +539,23 @@ +loadingInfo: LoadingInfo, } | { - +type: 'SAVE_DRAFT', + +type: 'UPDATE_DRAFT', +payload: { +key: string, - +draft: string, + +text: string, }, } + | { + +type: 'MOVE_DRAFT', + +payload: { + +oldKey: string, + +newKey: string, + }, + } + | { + +type: 'SET_DRAFT_STORE_DRAFTS', + +payload: $ReadOnlyArray<{ +key: string, +text: string }>, + } | { +type: 'UPDATE_ACTIVITY_STARTED', +payload?: 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 @@ -79,6 +79,7 @@ const defaultState = ({ navInfo: defaultNavInfo, currentUserInfo: null, + draftStore: { drafts: {} }, entryStore: { entryInfos: {}, daysToEntries: {}, 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 @@ -3,6 +3,7 @@ import type { Orientations } from 'react-native-orientation-locker'; import type { PersistState } from 'redux-persist/src/types'; +import type { DraftStore } from 'lib/types/draft-types'; import type { EnabledApps } from 'lib/types/enabled-apps'; import type { EntryStore } from 'lib/types/entry-types'; import type { CalendarFilter } from 'lib/types/filter-types'; @@ -24,6 +25,7 @@ export type AppState = { navInfo: NavInfo, currentUserInfo: ?CurrentUserInfo, + draftStore: DraftStore, entryStore: EntryStore, threadStore: ThreadStore, userStore: UserStore, 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 @@ -12,6 +12,7 @@ import { isLoggedIn } from 'lib/selectors/user-selectors'; import { invalidSessionDowngrade } from 'lib/shared/account-utils'; import type { Shape } from 'lib/types/core'; +import type { DraftStore } from 'lib/types/draft-types'; import type { EnabledApps } from 'lib/types/enabled-apps'; import type { EntryStore } from 'lib/types/entry-types'; import type { CalendarFilter } from 'lib/types/filter-types'; @@ -42,6 +43,7 @@ navInfo: NavInfo, deviceID: ?string, currentUserInfo: ?CurrentUserInfo, + draftStore: DraftStore, sessionID: ?string, entryStore: EntryStore, threadStore: ThreadStore,