From 28224b1e18e7d42430a5b22de93003fed8a33120 Mon Sep 17 00:00:00 2001 From: Richard Holzeis Date: Fri, 15 Sep 2023 09:19:48 +0200 Subject: [PATCH] chore: Set rollover and recover dialog to failed after timeout --- mobile/lib/common/recover_dlc_change_notifier.dart | 6 ++++++ mobile/lib/features/trade/rollover_change_notifier.dart | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/mobile/lib/common/recover_dlc_change_notifier.dart b/mobile/lib/common/recover_dlc_change_notifier.dart index 99a12bb33..425b6d315 100644 --- a/mobile/lib/common/recover_dlc_change_notifier.dart +++ b/mobile/lib/common/recover_dlc_change_notifier.dart @@ -32,6 +32,12 @@ class RecoverDlcChangeNotifier extends ChangeNotifier implements Subscriber { return TaskStatusDialog(title: "Catching up!", status: status, content: content); }, ); + + // setting the task status to failed after a timeout of 30 seconds. + Future.delayed(const Duration(seconds: 30), () { + taskStatus = TaskStatus.failed; + notifyListeners(); + }); } else { // notify dialog about changed task status notifyListeners(); diff --git a/mobile/lib/features/trade/rollover_change_notifier.dart b/mobile/lib/features/trade/rollover_change_notifier.dart index e72ca4623..d101df052 100644 --- a/mobile/lib/features/trade/rollover_change_notifier.dart +++ b/mobile/lib/features/trade/rollover_change_notifier.dart @@ -33,6 +33,12 @@ class RolloverChangeNotifier extends ChangeNotifier implements Subscriber { return TaskStatusDialog(title: "Catching up!", status: status, content: content); }, ); + + // setting the task status to failed after a timeout of 30 seconds. + Future.delayed(const Duration(seconds: 30), () { + taskStatus = TaskStatus.failed; + notifyListeners(); + }); } else { // notify dialog about changed task status notifyListeners();