@@ -27,26 +27,7 @@ const col = css`
2727 flex-direction: column;
2828` ;
2929
30- const store = $store (
31- {
32- url : "https://google.com" ,
33- wispurl :
34- _CONFIG ?. wispurl ||
35- ( location . protocol === "https:" ? "wss" : "ws" ) +
36- "://" +
37- location . host +
38- "/wisp/" ,
39- bareurl :
40- _CONFIG ?. bareurl ||
41- ( location . protocol === "https:" ? "https" : "http" ) +
42- "://" +
43- location . host +
44- "/bare/" ,
45- proxy : "" ,
46- } ,
47- { ident : "settings" , backing : "localstorage" , autosave : "auto" }
48- ) ;
49- connection . setTransport ( "/epoxy/index.mjs" , [ { wisp : store . wispurl } ] ) ;
30+ connection . setTransport ( store . transport , [ { wisp : store . wispurl } ] ) ;
5031
5132function Config ( ) {
5233 this . css = `
@@ -102,12 +83,22 @@ function Config() {
10283 < dialog class ="cfg " style ="background-color: #121212; color: white; border-radius: 8px; ">
10384 < div style ="align-self: end ">
10485 < div class =${ [ flex , "buttons" ] } >
105- < button on:click =${ ( ) => connection . setTransport ( "/baremod/index.mjs" , [ store . bareurl ] ) } > use bare server 3</ button >
106- < button on:click =${ ( ) =>
86+ < button on:click =${ ( ) => {
87+ connection . setTransport ( "/baremod/index.mjs" , [ store . bareurl ] ) ;
88+ store . transport = "/baremod/index.mjs" ;
89+ } } > use bare server 3</ button >
90+ < button on:click =${ ( ) => {
10791 connection . setTransport ( "/libcurl/index.mjs" , [
10892 { wisp : store . wispurl } ,
109- ] ) } > use libcurl.js</ button >
110- < button on:click =${ ( ) => connection . setTransport ( "/epoxy/index.mjs" , [ { wisp : store . wispurl } ] ) } > use epoxy</ button >
93+ ] ) ;
94+ store . transport = "/libcurl/index.mjs" ;
95+ } } > use libcurl.js</ button >
96+ < button on:click =${ ( ) => {
97+ connection . setTransport ( "/epoxy/index.mjs" , [
98+ { wisp : store . wispurl } ,
99+ ] ) ;
100+ store . transport = "/epoxy/index.mjs" ;
101+ } } > use epoxy</ button >
111102 </ div >
112103 </ div >
113104 < div class =${ [ flex , col , "input_row" ] } >
@@ -118,10 +109,10 @@ function Config() {
118109 < label for ="bare_url_input "> Bare URL:</ label >
119110 < input id ="bare_url_input " bind:value =${ use ( store . bareurl ) } spellcheck ="false"> </ input >
120111 </ div >
121- < div class = ${ [ flex , "buttons" , "centered" ] } >
122- < button on:click =${ ( ) => handleModalClose ( this . root ) } > close </ button >
123- </ div >
124-
112+ < div > ${ use ( store . transport ) } </ div >
113+ < div class =${ [ flex , "buttons" , "centered" ] } >
114+ < button on:click = ${ ( ) => handleModalClose ( this . root ) } > close </ button >
115+ </ div >
125116 </ dialog >
126117 ` ;
127118}
0 commit comments