|
1 | 1 | import 'dart:async'; |
2 | 2 | import 'dart:ffi'; |
3 | | -import 'dart:io'; |
4 | 3 |
|
5 | 4 | import 'package:cw_monero/api/convert_utf8_to_string.dart'; |
6 | 5 | import 'package:cw_monero/api/exceptions/setup_wallet_exception.dart'; |
@@ -368,25 +367,23 @@ bool priorityInQueue = false; |
368 | 367 |
|
369 | 368 | Future<bool> store({bool prioritySave = false}) async { |
370 | 369 | // Delay saves |
371 | | - if (Platform.isAndroid) { |
372 | | - if (priorityInQueue) { |
373 | | - return false; |
374 | | - } |
375 | | - print( |
376 | | - "${DateTime.now().millisecondsSinceEpoch} $prioritySave $priorityInQueue"); |
377 | | - if (DateTime.now().millisecondsSinceEpoch < storeTime + 90000 && |
378 | | - prioritySave) { |
379 | | - priorityInQueue = true; |
380 | | - await Future.delayed(Duration(seconds: 1)); |
381 | | - priorityInQueue = false; |
382 | | - return store(prioritySave: prioritySave); |
383 | | - } else if (DateTime.now().millisecondsSinceEpoch < storeTime + 90000 && |
384 | | - !prioritySave) { |
385 | | - return false; |
386 | | - } |
387 | | - print("released $storeTime"); |
388 | | - storeTime = DateTime.now().millisecondsSinceEpoch; |
| 370 | + if (priorityInQueue) { |
| 371 | + return false; |
| 372 | + } |
| 373 | + print( |
| 374 | + "${DateTime.now().millisecondsSinceEpoch} $prioritySave $priorityInQueue"); |
| 375 | + if (DateTime.now().millisecondsSinceEpoch < storeTime + 90000 && |
| 376 | + prioritySave) { |
| 377 | + priorityInQueue = true; |
| 378 | + await Future.delayed(Duration(seconds: 1)); |
| 379 | + priorityInQueue = false; |
| 380 | + return store(prioritySave: prioritySave); |
| 381 | + } else if (DateTime.now().millisecondsSinceEpoch < storeTime + 90000 && |
| 382 | + !prioritySave) { |
| 383 | + return false; |
389 | 384 | } |
| 385 | + print("released $storeTime"); |
| 386 | + storeTime = DateTime.now().millisecondsSinceEpoch; |
390 | 387 | await compute<int, void>(_storeSync, 0); |
391 | 388 | return true; |
392 | 389 | } |
|
0 commit comments