Refactored disconnect watcher
This commit is contained in:
parent
aa3a3b06a7
commit
93994d5dd7
@ -9,8 +9,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { watchEffect } from 'vue';
|
||||
|
||||
import Navbar from './Navbar.vue';
|
||||
import Login from './Login.vue';
|
||||
import RouteSchedule from './RouteSchedule.vue';
|
||||
@ -47,10 +45,7 @@
|
||||
].forEach(route => this.$root.$router.addRoute(route));
|
||||
await this.$root.$router.replace(this.$route);
|
||||
}
|
||||
if(value) {
|
||||
this.heartbeat = await value.heartbeat();
|
||||
var stop = watchEffect(() => { if(!value.connected.value) { stop(); this.client = this.server = this.user = null; } });
|
||||
}
|
||||
if(value) this.heartbeat = await value.heartbeat();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -45,6 +45,8 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { watchEffect } from 'vue';
|
||||
|
||||
import vistax from './vistax.mjs';
|
||||
|
||||
export default {
|
||||
@ -122,6 +124,7 @@
|
||||
this.$emit('update:server', this.x_server = (await this.x_client.serverinfo()).result);
|
||||
console.log('Backend secret', this.secret);
|
||||
console.log(this.banner);
|
||||
var stop = watchEffect(() => { if(!this.x_client.connected.value) { stop(); this.x_client = this.x_server = this.x_user = null; this.fail = true; } });
|
||||
} else this.fail = true;
|
||||
},
|
||||
async login(evt) {
|
||||
|
Loading…
Reference in New Issue
Block a user