mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 08:45:33 +02:00
Persist actions log time display settings in localStorage (#36623)
Persist the two boolean settings in the actions log into `localStorage` so that they are remembered across page reloads. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a6282c98d7
commit
26bb175d69
2 files changed
+17
-9
No files matched your search
@@ -58,8 +58,8 @@ export const localUserSettings = {
|
||||
getJsonObject: <T extends Record<string, any>>(key: string, def: T): T => {
|
||||
const value = getLocalStorageUserSetting(key);
|
||||
try {
|
||||
const decoded = value !== null ? JSON.parse(value) : def;
|
||||
return decoded ?? def;
|
||||
const decoded = value !== null ? JSON.parse(value) : null;
|
||||
return {...def, ...decoded};
|
||||
} catch (e) {
|
||||
console.error(`Unable to parse JSON value for local user settings ${key}=${value}`, e);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user