Skip to content

Commit

Permalink
Add explantory comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter York committed Mar 28, 2024
1 parent 02a0697 commit a0ea297
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/common/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export function setLocalStorageItem(name: string, content: string) {
try {
window.localStorage.setItem(name, content);
} catch (error: any) {
// Unfortunately it looks like we can't use typeof or instanceof to determine this one:
// all we get is that it's an object so if someone changess the wording we may have to add new checks
const isStorageQuotaError =
error.stack &&
error.stack.includes("exceeded the quota.");
Expand Down

0 comments on commit a0ea297

Please sign in to comment.