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

Function updatePluginDisabled

src/lib/loadPlugins.js:209–236  ·  view source on GitHub ↗
(pluginId, disabled)

Source from the content-addressed store, hash-verified

207}
208
209function updatePluginDisabled(pluginId, disabled) {
210 const updatePromise = pluginDisabledUpdateQueue
211 .catch(() => {})
212 .then(async () => {
213 const disabledMap = { ...(settings.value.pluginsDisabled || {}) };
214 if (!disabled && !(pluginId in disabledMap)) return;
215 if (disabledMap[pluginId] === disabled) return;
216
217 if (disabled) {
218 disabledMap[pluginId] = true;
219 } else {
220 delete disabledMap[pluginId];
221 }
222
223 await settings.update({ pluginsDisabled: disabledMap }, false);
224 });
225
226 pluginDisabledUpdateQueue = updatePromise.catch((error) => {
227 console.error("Failed to update plugin disabled state:", error);
228 window.log(
229 "error",
230 `Failed to update plugin (ID: ${pluginId}) disabled state:`,
231 );
232 window.log("error", error);
233 });
234
235 return updatePromise;
236}
237
238function isThemePlugin(pluginId) {
239 // Convert to lowercase for case-insensitive matching

Callers 2

markPluginLoadedFunction · 0.85
markPluginBrokenFunction · 0.85

Calls 3

logMethod · 0.80
updateMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected