store: use return type over a type cast
This commit is contained in:
parent
2878f87879
commit
c0b38d4762
@ -90,31 +90,30 @@ export type State = {
|
|||||||
searchEnabled: boolean;
|
searchEnabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const state = () =>
|
const state = (): State => ({
|
||||||
({
|
appLoaded: false,
|
||||||
appLoaded: false,
|
activeChannel: undefined,
|
||||||
activeChannel: undefined,
|
currentUserVisibleError: null,
|
||||||
currentUserVisibleError: null,
|
desktopNotificationState: detectDesktopNotificationState(),
|
||||||
desktopNotificationState: detectDesktopNotificationState(),
|
isAutoCompleting: false,
|
||||||
isAutoCompleting: false,
|
isConnected: false,
|
||||||
isConnected: false,
|
networks: [],
|
||||||
networks: [],
|
mentions: [],
|
||||||
mentions: [],
|
hasServiceWorker: false,
|
||||||
hasServiceWorker: false,
|
pushNotificationState: "unsupported",
|
||||||
pushNotificationState: "unsupported",
|
serverConfiguration: null,
|
||||||
serverConfiguration: null,
|
sessions: [],
|
||||||
sessions: [],
|
sidebarOpen: false,
|
||||||
sidebarOpen: false,
|
sidebarDragging: false,
|
||||||
sidebarDragging: false,
|
userlistOpen: storage.get("thelounge.state.userlist") !== "false",
|
||||||
userlistOpen: storage.get("thelounge.state.userlist") !== "false",
|
versionData: null,
|
||||||
versionData: null,
|
versionStatus: "loading",
|
||||||
versionStatus: "loading",
|
versionDataExpired: false,
|
||||||
versionDataExpired: false,
|
serverHasSettings: false,
|
||||||
serverHasSettings: false,
|
messageSearchResults: null,
|
||||||
messageSearchResults: null,
|
messageSearchPendingQuery: null,
|
||||||
messageSearchPendingQuery: null,
|
searchEnabled: false,
|
||||||
searchEnabled: false,
|
});
|
||||||
} as State);
|
|
||||||
|
|
||||||
type Getters = {
|
type Getters = {
|
||||||
findChannelOnCurrentNetwork: (state: State) => (name: string) => ClientChan | undefined;
|
findChannelOnCurrentNetwork: (state: State) => (name: string) => ClientChan | undefined;
|
||||||
|
Loading…
Reference in New Issue
Block a user