Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/sidebarApps/extensions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ const $header = (
<button type="button" className="icon-button" onclick={filterPlugins}>
<span className="icon tune" />
</button>
<button type="button" className="icon-button" onclick={addSource}>
<button
type="button"
className="icon-button"
onclick={() => addSource()}
>
<span className="icon add" />
</button>
</div>
Expand Down Expand Up @@ -362,17 +366,19 @@ async function filterPlugins() {
}
}

async function addSource() {
const sourceOption = [
["remote", strings.remote],
["local", strings.local],
];
const sourceType = await select("Select Source", sourceOption);
async function addSource(sourceType, value = "https://") {
if (!sourceType) {
const sourceOption = [
["remote", strings.remote],
["local", strings.local],
];
sourceType = await select("Select Source", sourceOption);
}

if (!sourceType) return;
let source;
if (sourceType === "remote") {
source = await prompt("Enter plugin source", "https://", "url");
source = await prompt("Enter plugin source", value, "url");
} else {
source = (await FileBrowser("file", "Select plugin source")).url;
}
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
"declaration": false,
"allowJs": true,
"checkJs": false,
"baseUrl": "./src",
"paths": {
"*": ["*"]
"*": ["./src/*"]
},
"jsx": "preserve",
"types": ["node"]
Expand Down