diff --git a/src/boot/store.js b/src/boot/store.js index 8800197bd42..da8295df30a 100644 --- a/src/boot/store.js +++ b/src/boot/store.js @@ -104,6 +104,9 @@ const migrations: { [string]: (GlobalState) => GlobalState } = { ackedPushToken: a.ackedPushToken !== undefined ? a.ackedPushToken : null, })), }), + + // $FlowMigrationFudge + '7': dropCache, }; const reduxPersistConfig: Config = { diff --git a/src/realm/realmReducer.js b/src/realm/realmReducer.js index ae1cf61db11..006db46b41a 100644 --- a/src/realm/realmReducer.js +++ b/src/realm/realmReducer.js @@ -14,6 +14,7 @@ import { const initialState = { canCreateStreams: true, crossRealmBots: [], + email: undefined, twentyFourHourTime: false, emoji: {}, filters: [], @@ -41,6 +42,7 @@ export default (state: RealmState = initialState, action: Action): RealmState => ...state, canCreateStreams: action.data.can_create_streams, crossRealmBots: action.data.cross_realm_bots, + email: action.data.email, emoji: convertRealmEmoji(action.data.realm_emoji), filters: action.data.realm_filters, isAdmin: action.data.is_admin, @@ -49,6 +51,8 @@ export default (state: RealmState = initialState, action: Action): RealmState => }; } + // TODO on EVENT_USER_UPDATE for self: update email, isAdmin, etc. + case EVENT_REALM_FILTERS: return { ...state, diff --git a/src/reduxTypes.js b/src/reduxTypes.js index 0cdfcac61a3..c7d626f0cc1 100644 --- a/src/reduxTypes.js +++ b/src/reduxTypes.js @@ -213,6 +213,7 @@ export type PresenceState = {| * @prop emoji * * About the user: + * @prop email * @prop twentyFourHourTime * @prop canCreateStreams * @prop isAdmin @@ -224,6 +225,7 @@ export type RealmState = {| filters: RealmFilter[], emoji: RealmEmojiById, + email: string | void, twentyFourHourTime: boolean, canCreateStreams: boolean, isAdmin: boolean,