mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
30 lines
923 B
TypeScript
30 lines
923 B
TypeScript
/**
|
|
* This slice is intended for the user configurable settings for the client such as appearance, autoplaying of links etc.
|
|
* Anything setting under the cog wheel tab.
|
|
*/
|
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
|
|
type TimerOptionsEntry = { name: string; value: number };
|
|
export type TimerOptionsArray = Array<TimerOptionsEntry>;
|
|
|
|
export type TimerOptionsState = {
|
|
timerOptions: TimerOptionsArray;
|
|
};
|
|
|
|
export const initialTimerOptionsState: TimerOptionsState = {
|
|
timerOptions: [],
|
|
};
|
|
|
|
const timerOptionSlice = createSlice({
|
|
name: 'timerOptions',
|
|
initialState: initialTimerOptionsState,
|
|
reducers: {
|
|
updateTimerOptions: (state, action: PayloadAction<TimerOptionsArray>) => {
|
|
return { ...state, timerOptions: action.payload };
|
|
},
|
|
},
|
|
});
|
|
|
|
const { actions, reducer } = timerOptionSlice;
|
|
export const { updateTimerOptions } = actions;
|
|
export const timerOptionReducer = reducer;
|