fix: fetchCheckTime fetchCheckStatus
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m20s

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-05-20 17:25:06 +07:00
parent ce97f7984a
commit 049143a385
2 changed files with 46 additions and 23 deletions

View file

@ -163,8 +163,19 @@ function reattachAndResizeMap(retry = 0) {
mapView.value.container = activeContainer
}
mapView.value.resize()
mapView.value.requestRender?.()
// resize() method
try {
if (typeof mapView.value.resize === 'function') {
mapView.value.resize()
}
} catch (error) {
console.warn('Map resize failed:', error)
}
if (typeof mapView.value.requestRender === 'function') {
mapView.value.requestRender?.()
}
mapView.value
.goTo(
{
@ -285,7 +296,11 @@ async function initializeMap() {
geometry: userPoint,
symbol: userSymbol,
})
mapView.value.graphics.add(userGraphic)
// graphics
if (mapView.value && mapView.value.graphics && !mapView.value.destroyed) {
mapView.value.graphics.add(userGraphic)
}
// Get POI place server .
// await axios
// .get(
@ -381,12 +396,22 @@ async function initializeMap() {
geometry: poiPoint,
symbol: poiSymbol,
})
mapView.value.graphics.add(poiGraphic)
// POI
mapView.value.goTo({
target: [userPoint, poiPoint],
zoom: zoomMap.value,
})
// graphics goTo
if (mapView.value && !mapView.value.destroyed) {
if (mapView.value.graphics) {
mapView.value.graphics.add(poiGraphic)
}
// POI
if (typeof mapView.value.goTo === 'function') {
mapView.value.goTo({
target: [userPoint, poiPoint],
zoom: zoomMap.value,
}).catch(() => {
// Ignore goTo errors
})
}
}
updateLocation(latitude, longitude, poiPlaceName.value)
})

View file

@ -638,19 +638,18 @@ async function fetchCheckStatus() {
/** inQueue เป็น true */
isDisabledCheckTime.value = true
msgCheckTime.value = 'ระบบกำลังประมวลผล'
if (intervalId.value === undefined) {
intervalId.value = setInterval(async () => {
try {
await fetchCheckStatus()
} catch (error) {
console.error('Error in interval fetchCheckStatus:', error)
// interval error
stopChecking()
}
}, 3000)
console.log('startChecking called, intervalId:', intervalId.value)
}
// hideLoader()
// if (intervalId.value === undefined) {
// intervalId.value = setInterval(async () => {
// try {
// await fetchCheckStatus()
// } catch (error) {
// console.error('Error in interval fetchCheckStatus:', error)
// // interval error
// stopChecking()
// }
// }, 3000)
// console.log('startChecking called, intervalId:', intervalId.value)
// }
} else {
/** inQueue เป็น false */
isDisabledCheckTime.value = false
@ -1126,7 +1125,6 @@ async function onClickConfirm() {
if (!statusCheckin.value) {
statusCheckin.value = true
}
await startChecking()
} finally {
hideLoader()
}