From ebc7ba07616f80dda6d486174d2cdb7748a9c676 Mon Sep 17 00:00:00 2001 From: Robin Scholtes Date: Mon, 24 Jul 2023 21:06:47 +1200 Subject: [PATCH] fix includes --- src/web/components/c-operation-li.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/web/components/c-operation-li.mjs b/src/web/components/c-operation-li.mjs index 02c55616..b42be9bf 100644 --- a/src/web/components/c-operation-li.mjs +++ b/src/web/components/c-operation-li.mjs @@ -23,7 +23,7 @@ export class COperationLi extends HTMLElement { this.includeStarIcon = includeStarIcon; this.config = this.app.operations[name]; - this.isFavourite = this.app.isLocalStorageAvailable() && localStorage.favourites?.includes(name); + this.isFavourite = this.app.isLocalStorageAvailable() && JSON.parse(localStorage.favourites).indexOf(name) >= 0; this.build(); @@ -63,7 +63,6 @@ export class COperationLi extends HTMLElement { */ handleClick(e) { if (e.target === this.querySelector("i.star-icon")) { - this.querySelector("li").classList.add("favourite"); this.app.addFavourite(this.name); } if (e.target === this.querySelector("i.remove-icon")) {