MCPcopy Create free account
hub / github.com/facebook/Rapid / setMostRecent

Method setMostRecent

modules/core/PresetSystem.js:566–574  ·  view source on GitHub ↗

* setMostRecent * Prepends a preset to the recently used presets array * @param A preset to add

(preset)

Source from the content-addressed store, hash-verified

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}

Callers 1

chooseMethod · 0.80

Calls 1

setItemMethod · 0.45

Tested by

no test coverage detected