Renamed connection status variable

This commit is contained in:
Jiang Yio 2023-05-01 19:29:19 -04:00
parent 525e23c790
commit a5b041ae9a
2 changed files with 3 additions and 3 deletions

View File

@ -132,7 +132,7 @@
this.$emit('update:server', this.x_server = (await this.x_client.serverinfo()).result); this.$emit('update:server', this.x_server = (await this.x_client.serverinfo()).result);
console.log('Backend secret', this.secret); console.log('Backend secret', this.secret);
console.log(this.banner); 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; } }); var stop = watchEffect(() => { if(!this.x_client.status.connected) { stop(); this.x_client = this.x_server = this.x_user = null; this.fail = true; } });
} else { } else {
this.fail = true; this.fail = true;
this.host = undefined; this.host = undefined;

View File

@ -284,12 +284,12 @@ export function Client(cid, secret) {
this.secret = secret; this.secret = secret;
this.cid = cid; this.cid = cid;
this.connected = reactive({ value: true }); this.status = reactive({ connected: true });
this.close = function() { this.close = function() {
console.log('CLOSE', cid); console.log('CLOSE', cid);
if(heartbeat) window.clearInterval(heartbeat); if(heartbeat) window.clearInterval(heartbeat);
this.connected.value = false; this.status.connected = false;
return vista.close(cid); return vista.close(cid);
}; };
this.call = async function(body, ...params) { this.call = async function(body, ...params) {