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

Function addSource

src/pages/plugins/plugins.js:783–801  ·  view source on GitHub ↗
(sourceType, value = "https://")

Source from the content-addressed store, hash-verified

781 }
782
783 async function addSource(sourceType, value = "https://") {
784 let source;
785 if (sourceType === "remote") {
786 source = await prompt("Enter plugin source", value, "url");
787 } else {
788 source = (await FileBrowser("file", "Select plugin source")).url;
789 }
790
791 if (!source) return;
792
793 try {
794 await installPlugin(source);
795 await getInstalledPlugins();
796 } catch (error) {
797 console.error(error);
798 window.toast(helpers.errorMessage(error));
799 addSource(sourceType, source);
800 }
801 }
802
803 async function onToggleEnabled(id, enabled) {
804 const disabledMap = settings.value.pluginsDisabled || {};

Callers 1

onselectFunction · 0.70

Calls 5

FileBrowserFunction · 0.85
getInstalledPluginsFunction · 0.85
promptFunction · 0.50
installPluginFunction · 0.50
errorMethod · 0.45

Tested by

no test coverage detected