Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
refactor setCache
Browse files Browse the repository at this point in the history
  • Loading branch information
maykar authored Jan 10, 2021
1 parent 47cfb88 commit 4d4ec66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kiosk-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function queryString(keywords) {

// Set localStorage item.
function setCache(k, v) {
window.localStorage.setItem(k, v);
array(k).forEach((x) => window.localStorage.setItem(x, v))
}

// Retrieve localStorage item as bool.
Expand Down Expand Up @@ -137,7 +137,7 @@ function kioskMode(lovelace, config) {
}

// Clear cache if requested.
if (queryString("clear_km_cache")) ["kmHeader", "kmSidebar"].forEach((k) => setCache(k, "false"));
if (queryString("clear_km_cache")) setCache(["kmHeader", "kmSidebar"], "false");

// Initial run.
run();
Expand Down

0 comments on commit 4d4ec66

Please sign in to comment.