From 7eb3b0ac458f0a3bc3f61407a3122c607a7c3bd4 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:56:36 +0200 Subject: [PATCH] Fix parsing storage value Regression ef6c1fce56539679f22fc5813e5e383b069cdae7 --- src/lib/storage/AppStorage.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/storage/AppStorage.ts b/src/lib/storage/AppStorage.ts index b7028034..d9fd085a 100644 --- a/src/lib/storage/AppStorage.ts +++ b/src/lib/storage/AppStorage.ts @@ -7,6 +7,8 @@ */ // eslint-disable-next-line max-classes-per-file +import { jsonSaveParse } from '@/lib/HelperFunctions.ts'; + export class Storage { constructor(private readonly storage: typeof window.localStorage) {} @@ -15,11 +17,7 @@ export class Storage { return defaultValue; } - if (typeof defaultValue === 'string') { - return value as T; - } - - return JSON.parse(value); + return jsonSaveParse(value) ?? (value as T); } getItem(key: string): string | null {