feat: Refresh task order list on window focus
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s

This commit is contained in:
Aif 2025-11-12 11:10:21 +07:00
parent 79d6482caa
commit f7a8416e7a

View file

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
// NOTE: Library // NOTE: Library
import { computed, onMounted, reactive, watch, ref } from 'vue'; import { computed, onMounted, onUnmounted, reactive, watch, ref } from 'vue';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
@ -147,6 +147,10 @@ async function deleteTaskOrder(id: string) {
}); });
} }
function handleWindowFocus() {
fetchTaskOrderList();
}
onMounted(async () => { onMounted(async () => {
pageState.gridView = $q.screen.lt.md ? true : false; pageState.gridView = $q.screen.lt.md ? true : false;
navigatorStore.current.title = 'taskOrder.title'; navigatorStore.current.title = 'taskOrder.title';
@ -157,6 +161,12 @@ onMounted(async () => {
if (route.query['tab'] && typeof route.query['tab'] === 'string') { if (route.query['tab'] && typeof route.query['tab'] === 'string') {
pageState.currentTab = route.query['tab']; pageState.currentTab = route.query['tab'];
} }
window.addEventListener('focus', handleWindowFocus);
});
onUnmounted(() => {
window.removeEventListener('focus', handleWindowFocus);
}); });
watch( watch(