@@ -48,7 +48,11 @@ const $header = (
4848 < button type = "button" className = "icon-button" onclick = { filterPlugins } >
4949 < span className = "icon tune" />
5050 </ button >
51- < button type = "button" className = "icon-button" onclick = { addSource } >
51+ < button
52+ type = "button"
53+ className = "icon-button"
54+ onclick = { ( ) => addSource ( ) }
55+ >
5256 < span className = "icon add" />
5357 </ button >
5458 </ div >
@@ -362,17 +366,19 @@ async function filterPlugins() {
362366 }
363367}
364368
365- async function addSource ( ) {
366- const sourceOption = [
367- [ "remote" , strings . remote ] ,
368- [ "local" , strings . local ] ,
369- ] ;
370- const sourceType = await select ( "Select Source" , sourceOption ) ;
369+ async function addSource ( sourceType , value = "https://" ) {
370+ if ( ! sourceType ) {
371+ const sourceOption = [
372+ [ "remote" , strings . remote ] ,
373+ [ "local" , strings . local ] ,
374+ ] ;
375+ sourceType = await select ( "Select Source" , sourceOption ) ;
376+ }
371377
372378 if ( ! sourceType ) return ;
373379 let source ;
374380 if ( sourceType === "remote" ) {
375- source = await prompt ( "Enter plugin source" , "https://" , "url" ) ;
381+ source = await prompt ( "Enter plugin source" , value , "url" ) ;
376382 } else {
377383 source = ( await FileBrowser ( "file" , "Select plugin source" ) ) . url ;
378384 }
0 commit comments