diff --git a/app/actions/settings.ts b/app/actions/settings.ts index 6f28570b2..77b8dcc77 100644 --- a/app/actions/settings.ts +++ b/app/actions/settings.ts @@ -1,6 +1,6 @@ import { Action } from 'redux'; -import { ISettings } from '../reducers/settings'; +import { ISettings, TSettings } from '../reducers/settings'; import { SETTINGS } from './actionsTypes'; interface IAddSettings extends Action { @@ -8,7 +8,7 @@ interface IAddSettings extends Action { } interface IUpdateSettings extends Action { - payload: { id: string; value: string }; + payload: { id: string; value: TSettings }; } export type IActionSettings = IAddSettings & IUpdateSettings; @@ -20,7 +20,7 @@ export function addSettings(settings: ISettings): IAddSettings { }; } -export function updateSettings(id: string, value: string): IUpdateSettings { +export function updateSettings(id: string, value: TSettings): IUpdateSettings { return { type: SETTINGS.UPDATE, payload: { id, value } diff --git a/app/reducers/settings.ts b/app/reducers/settings.ts index bcaad3019..028431ed0 100644 --- a/app/reducers/settings.ts +++ b/app/reducers/settings.ts @@ -1,8 +1,9 @@ import { IActionSettings } from '../actions/settings'; import { SETTINGS } from '../actions/actionsTypes'; -// TODO UPDATE SETTINGS TYPE -export type ISettings = Record; +export type TSettings = string | number | boolean; + +export type ISettings = Record; export const initialState: ISettings = {};