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