mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-07 06:57:12 -04:00
optimise
This commit is contained in:
parent
41d511a396
commit
5b25b74775
1 changed files with 2 additions and 12 deletions
|
@ -68,18 +68,8 @@ class HTMLOperation {
|
|||
html += "<i class='material-icons check-icon op-icon'>check</i>";
|
||||
}
|
||||
|
||||
let isFavourite;
|
||||
|
||||
if ( localStorage.favourites ) {
|
||||
console.log(localStorage.favourites);
|
||||
const favourites = JSON.parse(localStorage.favourites);
|
||||
isFavourite = favourites.includes(this.name);
|
||||
} else {
|
||||
isFavourite = false;
|
||||
}
|
||||
|
||||
console.log(isFavourite);
|
||||
|
||||
// check if local storage has favourites at all
|
||||
const isFavourite = 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