feat: migrate old list settings

This commit is contained in:
kolaente 2023-01-18 14:04:16 +01:00
parent 0e6c219800
commit ac0b4dcf36
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,13 @@ export function saveProjectView(projectId: IProject['id'], routeName: string) {
}
export const getProjectView = (projectId: IProject['id']) => {
// Migrate old setting over
const oldListViewSettings = localStorage.getItem('listView')
if (oldListViewSettings !== null) {
localStorage.setItem('projectView', oldListViewSettings)
localStorage.removeItem('listView')
}
// Remove old stored settings
const savedProjectView = localStorage.getItem('projectView')
if (savedProjectView !== null && savedProjectView.startsWith('project.')) {