mirror of
https://github.com/imputnet/cobalt.git
synced 2024-12-29 11:06:10 +00:00
web/settings: write to storage if migrated
This commit is contained in:
parent
30b7003871
commit
0a471943ca
|
@ -77,7 +77,7 @@ const loadFromStorage = () => {
|
||||||
export const loadFromString = (settings: string): PartialSettings => {
|
export const loadFromString = (settings: string): PartialSettings => {
|
||||||
const parsed = JSON.parse(settings) as AllPartialSettingsWithSchema;
|
const parsed = JSON.parse(settings) as AllPartialSettingsWithSchema;
|
||||||
if (parsed.schemaVersion < defaultSettings.schemaVersion) {
|
if (parsed.schemaVersion < defaultSettings.schemaVersion) {
|
||||||
return migrate(parsed);
|
return writeToStorage(migrate(parsed));
|
||||||
}
|
}
|
||||||
|
|
||||||
return parsed as PartialSettings;
|
return parsed as PartialSettings;
|
||||||
|
|
Loading…
Reference in a new issue