Skip to content

Commit

Permalink
Fixed clearPanels method
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomThomson committed Feb 25, 2021
1 parent 8b285d4 commit 31507ce
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export class DashboardPanelStorage {

public clearPanels(id = DASHBOARD_PANELS_UNSAVED_ID) {
try {
const sessionStoragePanels =
this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId] || {};
if (sessionStoragePanels[id]) {
delete sessionStoragePanels[id];
this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStoragePanels);
const sessionStorage = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY);
const sessionStorageForSpace = sessionStorage?.[this.activeSpaceId] || {};
if (sessionStorageForSpace[id]) {
delete sessionStorageForSpace[id];
this.sessionStorage.set(DASHBOARD_PANELS_SESSION_KEY, sessionStorage);
}
} catch (e) {
this.toasts.addDanger({
Expand Down

0 comments on commit 31507ce

Please sign in to comment.