Skip to content

Commit

Permalink
Improve filter reload required message
Browse files Browse the repository at this point in the history
  • Loading branch information
bubner committed Aug 23, 2023
1 parent e733160 commit 07dbd64
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/windows/FilterWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ function FilterWindow() {
if (oldStorage.includes(word.value)) return;
oldStorage.push(word.value);
localStorage.setItem("filterlist", JSON.stringify(oldStorage));
// Edit the last item to include (reload required) for the end user
oldStorage[oldStorage.length - 1] = word.value + " (reload required)";
setBlacklist(oldStorage);
// Edit all the words to include the reload required message
setBlacklist(oldStorage.map((w: string) => w + " (reload required)"));
} finally {
word.value = "";
}
Expand All @@ -67,7 +66,7 @@ function FilterWindow() {
if (index > -1) {
oldStorage.splice(index, 1);
localStorage.setItem("filterlist", JSON.stringify(oldStorage));
setBlacklist(oldStorage);
setBlacklist(oldStorage.map((w: string) => w + " (reload required)"));
}
}

Expand Down

0 comments on commit 07dbd64

Please sign in to comment.