MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / push

Function push

src/palettes/commandPalette/index.js:55–65  ·  view source on GitHub ↗

* Saves command to recently used commands * @param {string} command Command name * @returns {void}

(command)

Source from the content-addressed store, hash-verified

53 * @returns {void}
54 */
55 push(command) {
56 const { commands } = this;
57 if (commands.length > 10) {
58 commands.pop();
59 }
60 if (commands.includes(command)) {
61 commands.splice(commands.indexOf(command), 1);
62 }
63 commands.unshift(command);
64 localStorage.setItem("recentlyUsedCommands", JSON.stringify(commands));
65 },
66 };
67}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected