fix: fetchCheckTime fetchCheckStatus
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m20s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 2m20s
This commit is contained in:
parent
ce97f7984a
commit
049143a385
2 changed files with 46 additions and 23 deletions
|
|
@ -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)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue