feat: Refresh task order list on window focus
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 6s
This commit is contained in:
parent
79d6482caa
commit
f7a8416e7a
1 changed files with 11 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
// NOTE: Library
|
||||
import { computed, onMounted, reactive, watch, ref } from 'vue';
|
||||
import { computed, onMounted, onUnmounted, reactive, watch, ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useQuasar } from 'quasar';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
|
@ -147,6 +147,10 @@ async function deleteTaskOrder(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function handleWindowFocus() {
|
||||
fetchTaskOrderList();
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
pageState.gridView = $q.screen.lt.md ? true : false;
|
||||
navigatorStore.current.title = 'taskOrder.title';
|
||||
|
|
@ -157,6 +161,12 @@ onMounted(async () => {
|
|||
if (route.query['tab'] && typeof route.query['tab'] === 'string') {
|
||||
pageState.currentTab = route.query['tab'];
|
||||
}
|
||||
|
||||
window.addEventListener('focus', handleWindowFocus);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('focus', handleWindowFocus);
|
||||
});
|
||||
|
||||
watch(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue