dtpublic/malhar-angular-dashboard

layoutOptions.storage.removeItem not called

Opened this issue · 0 comments

Current behavior:

  • Click 'x' to remove layout
  • removeLayout(layout) is called, then layoutStorage.remove(layout) is called
  • We delete this.states[layout.id]
  • layoutStorage.save() is called, then this.storage.setItem

Expected behavior:
After deleting the layout from states, I'd expect this.storage.removeItem() to be called, though I'm not really sure what the intended behavior of that method is other than to handle mismatched hashes.

Using anything other than localStorage, and storing layouts individually, it becomes a pain to detect when a layout was removed, since at present it calls this.storage.setItem as any other change would. Further, it doesn't seem that removeItem is ever realistically called when using dashboard-layouts.