fix: wait for 5s after syncCamera then refetch polling

This commit is contained in:
yangsy
2025-11-28 14:41:48 +08:00
parent fb7657f99c
commit 4272cd90de

View File

@@ -3,6 +3,7 @@ import { syncCameraApi, syncNvrChannelsApi, type Station } from '@/apis';
import { DeviceAlarmDetailModal, DeviceExportModal, DeviceParamsConfigModal, OfflineDeviceDetailModal, RecordCheckExportModal, StationCard } from '@/components';
import { useLineAlarmsQuery, useLineDevicesQuery } from '@/composables';
import { useAlarmStore, useDeviceStore, usePollingStore, useSettingStore, useStationStore } from '@/stores';
import { sleep } from '@/utils';
import { useMutation } from '@tanstack/vue-query';
import { NGrid, NGi, NScrollbar, NFlex, NButtonGroup, NButton, NCheckbox } from 'naive-ui';
import { storeToRefs } from 'pinia';
@@ -71,6 +72,7 @@ const { mutate: syncCamera, isPending: cameraSyncing } = useMutation({
.map(([code]) => code);
for (const stationCode of stationCodes) {
await syncCameraApi({ stationCode });
await sleep(5000);
}
},
onSuccess: () => {