Skip to content

Commit

Permalink
Add try/catch block around localStorage.setItem call (#11546)
Browse files Browse the repository at this point in the history
  • Loading branch information
dotsam authored Nov 19, 2023
1 parent 249c93d commit e3a5916
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion themes-default/slim/src/store/modules/shows.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ const actions = {

// Update (namespaced) localStorage
const namespace = rootState.config.system.webRoot ? `${rootState.config.system.webRoot}_` : '';
localStorage.setItem(`${namespace}shows`, JSON.stringify(state.shows));
try {
localStorage.setItem(`${namespace}shows`, JSON.stringify(state.shows));
} catch (error) {
console.warn(error);
}
},
updateShowQueueItem(context, queueItem) {
// Update store's search queue item. (provided through websocket)
Expand Down
Loading

0 comments on commit e3a5916

Please sign in to comment.