mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 15:55:01 -04:00
add local storage availability check, prep for code review
This commit is contained in:
parent
5b25b74775
commit
02a4dd5bd3
9 changed files with 39 additions and 261 deletions
|
@ -68,8 +68,8 @@ class HTMLOperation {
|
|||
html += "<i class='material-icons check-icon op-icon'>check</i>";
|
||||
}
|
||||
|
||||
// check if local storage has favourites at all
|
||||
const isFavourite = localStorage.favourites?.includes(this.name)
|
||||
// check if local storage is available *and* has favourites at all ( otherwise we use the default favs )
|
||||
const isFavourite = this.app.isLocalStorageAvailable() && localStorage.favourites?.includes(this.name);
|
||||
|
||||
if (window.innerWidth < this.app.breakpoint) {
|
||||
html += `<i title="${this.name}" class='material-icons icon-add-favourite star-icon op-icon ${isFavourite ? "fav-op" : ""}'>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue