File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11import { defineStore } from 'pinia'
2+ import { useStorage } from '@vueuse/core'
23
34export const use_cloud_store = defineStore ( 'cloud' , {
45 state : ( ) => ( {
5- ID : '' ,
6+ ID : useStorage ( 'ID' , '' ) ,
67 is_captcha_validated : false ,
78 is_cloud_running : false ,
89 is_connexion_launched : false ,
@@ -31,14 +32,12 @@ export const use_cloud_store = defineStore('cloud', {
3132 async create_connexion ( ) {
3233 if ( this . is_connexion_launched ) { return }
3334 this . is_connexion_launched = true
34- const ID = localStorage . getItem ( 'ID' )
35- if ( ID === null || typeof ID === 'undefined' ) {
35+ if ( this . ID === '' || this . ID === null || typeof this . ID === 'undefined' ) {
3636 return this . create_backend ( )
3737 } else {
3838 const { data, error } = await useFetch ( `${ this . geode_url } /ping` , { method : 'POST' } )
3939 console . log ( "error" , error )
4040 if ( data . value !== null ) {
41- this . ID = ID
4241 this . is_cloud_running = true
4342 return this . ping_task ( )
4443 } else {
You can’t perform that action at this time.
0 commit comments