Skip to content

Commit

Permalink
Merge pull request #122 from csgofloat/fix/old-filter-loading
Browse files Browse the repository at this point in the history
Fix Loading Old Filters (from before v3)
  • Loading branch information
Step7750 authored Oct 21, 2022
2 parents 1e19e12 + b9a6be9 commit 539fdde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/storage/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ class Store {
return null;
}

return JSON.parse(a[key]) as T;
try {
return JSON.parse(a[key]) as T;
} catch (e) {
// Fallback if this is an old key not stored as JSON
return a[key] as T;
}
}

async set<T>(key: StorageKey | DynamicStorageKey, value: T): Promise<void> {
Expand Down

0 comments on commit 539fdde

Please sign in to comment.