Fix missing status bug for deleted party line
This commit is contained in:
parent
2e6228128a
commit
4e9c4ecb64
1 changed files with 9 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<div class="w-screen text-center">
|
||||
<input type="text" v-model="partyLineModel" placeholder="Enter Party Line" class="input input-bordered w-full max-w-xs" />
|
||||
<input type="text" v-model="partyLineModel" placeholder="Enter Party Line"
|
||||
class="input input-bordered w-full max-w-xs"/>
|
||||
<button class="btn btn-outline btn-success" @click="joinPartyLine">Join Party Line</button>
|
||||
<br/>
|
||||
<p v-if="status"><small>{{ status }}</small></p>
|
||||
|
@ -9,7 +10,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { usePartyLineStore } from '../stores/partyLine';
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useGetServer } from "@/composables/useGetServer.ts";
|
||||
|
@ -21,15 +22,15 @@ const partyLineStore = usePartyLineStore();
|
|||
|
||||
const { partyLine, partyLineDeletedFlag, eventSource } = storeToRefs(partyLineStore);
|
||||
|
||||
onMounted(() => {
|
||||
if (partyLineDeletedFlag.value) {
|
||||
error.value = 'Party Line has been deleted by the admin';
|
||||
}
|
||||
|
||||
watch(eventSource, () => {
|
||||
if (!eventSource.value?.readyState) {
|
||||
status.value = 'Not connected to any Party Lines...';
|
||||
}
|
||||
});
|
||||
}, { immediate: true });
|
||||
|
||||
watch(partyLineDeletedFlag, () => {
|
||||
error.value = 'Party Line has been deleted by the admin';
|
||||
}, { immediate: true });
|
||||
|
||||
const partyLineModel = computed({
|
||||
get: () => partyLineName.value ? partyLineName.value : partyLine.value,
|
||||
|
|
Loading…
Add table
Reference in a new issue