completed first web iteration
This commit is contained in:
@@ -76,15 +76,22 @@ class GatewayController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> pollTransaction(String uid) async {
|
||||
// only poll for 5 minutes
|
||||
int max = 30;
|
||||
while (!model.isCancelled) {
|
||||
max++;
|
||||
// Check cancellation flag instead of true
|
||||
// Wait 5 seconds before the next poll
|
||||
await Future.delayed(const Duration(seconds: 5));
|
||||
await Future.delayed(const Duration(seconds: 10));
|
||||
|
||||
// Check again after delay in case it was cancelled during the delay
|
||||
if (model.isCancelled) break;
|
||||
|
||||
await poll(uid);
|
||||
|
||||
if(max > 30) {
|
||||
model.isCancelled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user