@@ -5,16 +5,15 @@ export const use_infra_store = defineStore("infra", {
55 state : ( ) => ( {
66 app_mode : getAppMode ( ) ,
77 ID : useStorage ( "ID" , "" ) ,
8- is_captcha_validated : true ,
8+ is_captcha_validated : this . app_mode == appMode . appMode . CLOUD ? false : true ,
99 status : Status . NOT_CREATED ,
1010 } ) ,
1111 getters : {
1212 domain_name ( ) {
13- if ( this . app_mode == appMode . CLOUD ) {
13+ if ( this . app_mode == appMode . appMode . CLOUD ) {
1414 return useRuntimeConfig ( ) . public . API_URL
15- } else {
16- return "localhost"
1715 }
16+ return "localhost"
1817 } ,
1918 lambda_url ( ) {
2019 const geode_store = use_geode_store ( )
@@ -44,6 +43,7 @@ export const use_infra_store = defineStore("infra", {
4443 async create_backend ( ) {
4544 console . log ( "create_backend" )
4645 if ( this . status === Status . CREATED ) return
46+ console . log ( "1" )
4747 return navigator . locks . request ( "infra.create_backend" , async ( lock ) => {
4848 this . status = Status . CREATING
4949 if ( this . status === Status . CREATED ) return
@@ -52,14 +52,15 @@ export const use_infra_store = defineStore("infra", {
5252 const geode_store = use_geode_store ( )
5353 const viewer_store = use_viewer_store ( )
5454 const feedback_store = use_feedback_store ( )
55- if ( this . app_mode == appMode . CLOUD ) {
55+ if ( this . app_mode == appMode . appMode . DESKTOP ) {
5656 const back_port = await window . electronAPI . run_back ( geode_store . port )
5757 geode_store . $patch ( { default_local_port : back_port } )
5858 const viewer_port = await window . electronAPI . run_viewer (
5959 viewer_store . port ,
6060 )
6161 viewer_store . $patch ( { default_local_port : viewer_port } )
62- } else {
62+ }
63+ if ( this . app_mode == appMode . appMode . CLOUD ) {
6364 const { data, error } = await useFetch ( this . lambda_url , {
6465 method : "POST" ,
6566 } )
0 commit comments