mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 16:44:26 +00:00
prevent from json error
This commit is contained in:
parent
43abcc42ae
commit
32e7a13b60
@ -49,8 +49,11 @@ type LocaleStorageOptions = {
|
||||
};
|
||||
|
||||
function getLocaleStorageOptions(): LocaleStorageOptions {
|
||||
const optsJson = localStorage.getItem('actions-view-options');
|
||||
if (optsJson) return JSON.parse(optsJson);
|
||||
try {
|
||||
const optsJson = localStorage.getItem('actions-view-options');
|
||||
if (optsJson) return JSON.parse(optsJson);
|
||||
} catch {}
|
||||
// if no options in localStorage, or failed to parse, return default options
|
||||
return {autoScroll: true, expandRunning: false};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user