connect client only when authenticated
This commit is contained in:
parent
582a974161
commit
06edeb234d
1 changed files with 5 additions and 1 deletions
|
@ -28,6 +28,11 @@ import { useMissionStore } from "./stores/admin/operation/mission";
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
watch: {
|
watch: {
|
||||||
|
authCheck() {
|
||||||
|
if (this.authCheck) {
|
||||||
|
this.connectClient();
|
||||||
|
}
|
||||||
|
},
|
||||||
connectionStatus() {
|
connectionStatus() {
|
||||||
if (this.connectionStatus) {
|
if (this.connectionStatus) {
|
||||||
this.initialize();
|
this.initialize();
|
||||||
|
@ -48,7 +53,6 @@ export default defineComponent({
|
||||||
window.addEventListener("online", function (e) {
|
window.addEventListener("online", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
this.connectClient();
|
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
window.removeEventListener("online", function (e) {
|
window.removeEventListener("online", function (e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue