mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-09 02:05:28 +00:00
Add client context.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { State } from "..";
|
||||
import { combineReducers } from "redux";
|
||||
|
||||
import { config, ConfigAction } from "./server_config";
|
||||
import { settings, SettingsAction } from "./settings";
|
||||
import { locale, LocaleAction } from "./locale";
|
||||
import { auth, AuthAction } from "./auth";
|
||||
@@ -12,6 +13,7 @@ import { sync, SyncAction } from "./sync";
|
||||
import { experiments, ExperimentsAction } from "./experiments";
|
||||
|
||||
export default combineReducers({
|
||||
config,
|
||||
locale,
|
||||
auth,
|
||||
settings,
|
||||
@@ -24,6 +26,7 @@ export default combineReducers({
|
||||
});
|
||||
|
||||
export type Action =
|
||||
| ConfigAction
|
||||
| LocaleAction
|
||||
| AuthAction
|
||||
| SettingsAction
|
||||
|
||||
20
src/redux/reducers/server_config.ts
Normal file
20
src/redux/reducers/server_config.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Core } from "revolt.js/dist/api/objects";
|
||||
|
||||
export type ConfigAction =
|
||||
| { type: undefined }
|
||||
| {
|
||||
type: "SET_CONFIG";
|
||||
config: Core.RevoltNodeConfiguration;
|
||||
};
|
||||
|
||||
export function config(
|
||||
state = { } as Core.RevoltNodeConfiguration,
|
||||
action: ConfigAction
|
||||
): Core.RevoltNodeConfiguration {
|
||||
switch (action.type) {
|
||||
case "SET_CONFIG":
|
||||
return action.config;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user