fix: increase type safety of local storage settings

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-06-08 14:05:11 +02:00
parent c0a65a0e09
commit 5b5dabc84e
4 changed files with 58 additions and 31 deletions

View file

@ -9,6 +9,7 @@ import { isDevMode, isTestMode } from '../../../utils/test-modes'
import { fetchAndSetUser } from '../../login-page/auth/utils'
import { loadDarkMode } from './load-dark-mode'
import { setUpI18n } from './setupI18n'
import { loadFromLocalStorage } from '../../../redux/editor/methods'
const logger = new Logger('Application Loader')
@ -62,9 +63,18 @@ export const createSetUpTaskList = (): InitTask[] => {
name: 'Load history state',
task: refreshHistoryState
},
{
name: 'Load preferences',
task: loadFromLocalStorageAsync
},
{
name: 'Add Delay',
task: customDelay
}
]
}
const loadFromLocalStorageAsync = (): Promise<void> => {
loadFromLocalStorage()
return Promise.resolve()
}