Changeset View
Standalone View
web/redux/redux-setup.js
Show All 20 Lines | |||||
import type { DraftStore } from 'lib/types/draft-types.js'; | import type { DraftStore } from 'lib/types/draft-types.js'; | ||||
import type { EnabledApps } from 'lib/types/enabled-apps.js'; | import type { EnabledApps } from 'lib/types/enabled-apps.js'; | ||||
import type { EntryStore } from 'lib/types/entry-types.js'; | import type { EntryStore } from 'lib/types/entry-types.js'; | ||||
import { | import { | ||||
type CalendarFilter, | type CalendarFilter, | ||||
calendarThreadFilterTypes, | calendarThreadFilterTypes, | ||||
} from 'lib/types/filter-types.js'; | } from 'lib/types/filter-types.js'; | ||||
import type { LifecycleState } from 'lib/types/lifecycle-state-types.js'; | import type { LifecycleState } from 'lib/types/lifecycle-state-types.js'; | ||||
import type { InviteLinksStore } from 'lib/types/link-types.js'; | |||||
import type { LoadingStatus } from 'lib/types/loading-types.js'; | import type { LoadingStatus } from 'lib/types/loading-types.js'; | ||||
import type { MessageStore } from 'lib/types/message-types.js'; | import type { MessageStore } from 'lib/types/message-types.js'; | ||||
import type { UserPolicies } from 'lib/types/policy-types.js'; | import type { UserPolicies } from 'lib/types/policy-types.js'; | ||||
import type { BaseAction } from 'lib/types/redux-types.js'; | import type { BaseAction } from 'lib/types/redux-types.js'; | ||||
import type { ReportStore } from 'lib/types/report-types.js'; | import type { ReportStore } from 'lib/types/report-types.js'; | ||||
import type { ConnectionInfo } from 'lib/types/socket-types.js'; | import type { ConnectionInfo } from 'lib/types/socket-types.js'; | ||||
import type { ThreadStore } from 'lib/types/thread-types.js'; | import type { ThreadStore } from 'lib/types/thread-types.js'; | ||||
import type { CurrentUserInfo, UserStore } from 'lib/types/user-types.js'; | import type { CurrentUserInfo, UserStore } from 'lib/types/user-types.js'; | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | export type AppState = { | ||||
nextLocalID: number, | nextLocalID: number, | ||||
dataLoaded: boolean, | dataLoaded: boolean, | ||||
windowActive: boolean, | windowActive: boolean, | ||||
userPolicies: UserPolicies, | userPolicies: UserPolicies, | ||||
cryptoStore: CryptoStore, | cryptoStore: CryptoStore, | ||||
pushApiPublicKey: ?string, | pushApiPublicKey: ?string, | ||||
_persist: ?PersistState, | _persist: ?PersistState, | ||||
+commServicesAccessToken: ?string, | +commServicesAccessToken: ?string, | ||||
+inviteLinksStore: InviteLinksStore, | |||||
kamil: It's not optional so you have to add this to the [initial state](https://github. | |||||
tomekAuthorUnsubmitted Done Inline ActionsI guess it's ok - it will be introduced on web soon. On the other hand, we could wait with introducing it on web until the diffs are up - but it shouldn't matter. tomek: I guess it's ok - it will be introduced on web soon. On the other hand, we could wait with… | |||||
kamilUnsubmitted Not Done Inline ActionsI still do not feel comfortable with the fact, that we create places (like this one in this particular case) where we assume that variable is of a given type but it isn't, but agree, it shouldn't matter kamil: I still do not feel comfortable with the fact, that we create places (like [this one](https… | |||||
tomekAuthorUnsubmitted Done Inline ActionsYeah, that's not great, but a possible solution would require a lot of work and maintenance. For one migration it doesn't sound bad: we can have a type without one field. But then, when another migration adds yet another field, we would need three types: one for AppState, one without one field, and one without two. It feels like it's really not worth it... maybe if we frequently encounter bugs caused by these types we could investigate other options, but up to this point I don't remember any accident caused by this. tomek: Yeah, that's not great, but a possible solution would require a lot of work and maintenance. | |||||
}; | }; | ||||
export type Action = | export type Action = | ||||
| BaseAction | | BaseAction | ||||
| { type: 'UPDATE_NAV_INFO', payload: Shape<NavInfo> } | | { type: 'UPDATE_NAV_INFO', payload: Shape<NavInfo> } | ||||
| { | | { | ||||
type: 'UPDATE_WINDOW_DIMENSIONS', | type: 'UPDATE_WINDOW_DIMENSIONS', | ||||
payload: WindowDimensions, | payload: WindowDimensions, | ||||
▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines |
It's not optional so you have to add this to the initial state on the web as the client will expect this object to be defined.