From 8893db0cbcf3d6934e70dbea772628e77bb9bd0e Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 18 Jul 2019 07:43:42 +0200 Subject: [PATCH] js: Drop a StorageAwareMap entirely from storage if all keys expired --- public/js/icinga/storage.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/js/icinga/storage.js b/public/js/icinga/storage.js index 6447a3a74..d9df2c668 100644 --- a/public/js/icinga/storage.js +++ b/public/js/icinga/storage.js @@ -234,7 +234,12 @@ }, this); } - storage.set(key, items); + if (!! items && items.length) { + storage.set(key, items); + } else if(items !== null) { + storage.remove(key); + } + return (new Icinga.Storage.StorageAwareMap(items).setStorage(storage, key)); };