mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
26 lines
602 B
TypeScript
26 lines
602 B
TypeScript
import { createSlice, type PayloadAction } from '@reduxjs/toolkit';
|
|
import { isDebugMode } from '../../shared/env_vars';
|
|
|
|
export interface DebugState {
|
|
debugMode: boolean;
|
|
}
|
|
|
|
export const initialDebugState = {
|
|
debugMode: isDebugMode(),
|
|
};
|
|
|
|
const debugSlice = createSlice({
|
|
name: 'debug',
|
|
initialState: initialDebugState,
|
|
reducers: {
|
|
setDebugMode: (state, action: PayloadAction<boolean>) => {
|
|
state.debugMode = action.payload;
|
|
return state;
|
|
},
|
|
},
|
|
});
|
|
|
|
const { actions, reducer } = debugSlice;
|
|
export const { setDebugMode } = actions;
|
|
export const debugReducer = reducer;
|