(id: string, settings: ChopsSettings)
| 211 | } |
| 212 | |
| 213 | toggleFavorite(id: string, settings: ChopsSettings): void { |
| 214 | const item = this.items.get(id); |
| 215 | if (!item) return; |
| 216 | item.isFavorite = !item.isFavorite; |
| 217 | if (item.isFavorite) { |
| 218 | if (!settings.favorites.includes(id)) settings.favorites.push(id); |
| 219 | } else { |
| 220 | settings.favorites = settings.favorites.filter((f) => f !== id); |
| 221 | } |
| 222 | this.trigger("updated"); |
| 223 | } |
| 224 | |
| 225 | getToolCounts(): Map<string, number> { |
| 226 | const counts = new Map<string, number>(); |