feat: Refresh quotation 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:27:55 +07:00
parent f7a8416e7a
commit 15a812b50e

View file

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, reactive, ref, watch, computed } from 'vue'; import { onMounted, onUnmounted, reactive, ref, watch, computed } 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';
@ -275,6 +275,10 @@ const customerNameInfo = computed(() => {
return name || '-'; return name || '-';
}); });
function handleWindowFocus() {
fetchQuotationList();
}
onMounted(async () => { onMounted(async () => {
pageState.gridView = $q.screen.lt.md ? true : false; pageState.gridView = $q.screen.lt.md ? true : false;
navigatorStore.current.title = 'quotation.title'; navigatorStore.current.title = 'quotation.title';
@ -312,6 +316,12 @@ onMounted(async () => {
} }
flowStore.rotate(); flowStore.rotate();
window.addEventListener('focus', handleWindowFocus);
});
onUnmounted(() => {
window.removeEventListener('focus', handleWindowFocus);
}); });
async function fetchQuotationList(mobileFetch?: boolean) { async function fetchQuotationList(mobileFetch?: boolean) {