(sourceType, value = "https://")
| 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 || {}; |
no test coverage detected