fix: wait for 5s after syncCamera then refetch polling
This commit is contained in:
@@ -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: () => {
|
||||
|
||||
Reference in New Issue
Block a user