* setMostRecent * Prepends a preset to the recently used presets array * @param A preset to add
(preset)
| 564 | * @param A preset to add |
| 565 | */ |
| 566 | setMostRecent(preset) { |
| 567 | if (preset.searchable === false) return; |
| 568 | |
| 569 | this._recentIDs.unshift(preset.id); // prepend array |
| 570 | this._recentIDs = utilArrayUniq(this._recentIDs).slice(0, MAXRECENTS); |
| 571 | |
| 572 | const storage = this.context.systems.storage; |
| 573 | storage.setItem('preset_recents', JSON.stringify(this._recentIDs)); |
| 574 | } |
| 575 | |
| 576 | } |