fix: fetchData position review

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-04-23 18:09:48 +07:00
parent 3da965dc0e
commit ab1ea1f614

View file

@ -886,12 +886,20 @@ async function fetchDataCommandCode() {
// }
onMounted(async () => {
// delay dataStore fetch position
await new Promise((resolve) => setTimeout(resolve, 800));
if (dataStore.officerType && dataStore.profileId) {
await Promise.all([fetchData(), fetchDataCommandCode()]);
}
});
watch(
() => [dataStore.officerType, dataStore.profileId],
async ([officerType, profileId]) => {
if (officerType && profileId) {
await Promise.all([fetchData(), fetchDataCommandCode()]);
}
},
{ immediate: true },
);
</script>
<template>