mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-11 11:05:28 +00:00
Add client context.
This commit is contained in:
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