修复完成作业停止之后再开始作业

This commit is contained in:
2026-03-12 16:41:11 +08:00
parent 8a91d5b334
commit c58bf370e3
4 changed files with 17 additions and 1 deletions

View File

@@ -391,6 +391,8 @@ class DevicesCubit extends Cubit<DevicesState> {
Future<void> stopRoutePlanning() async {
emit(state.copyWith(isLoading: true));
final result = await _routePlanningUseCase.stopRoutePlanning();
// 🔥 重置 PathPlanningService 中的全局的队列
_pathPlanningService.clear();
result.fold((failure) => emit(state.copyWith(isLoading: false, errorMessage: failure.message ?? '停止失败')), (_) => emit(state.copyWith(isLoading: false)));
}