solyanka iz fix for payout page design, ledger wallet now clickable

This commit is contained in:
Arseni
2026-03-05 15:48:52 +03:00
parent a9b00b6871
commit d6a3a0cc5b
31 changed files with 596 additions and 370 deletions

View File

@@ -13,6 +13,7 @@ class WalletTransactionsProvider extends ChangeNotifier {
bool _isLoading = false;
String? _error;
String? _walletId;
int _loadSeq = 0;
List<WalletTransaction> get transactions => List.unmodifiable(_transactions);
bool get isLoading => _isLoading;
@@ -20,18 +21,28 @@ class WalletTransactionsProvider extends ChangeNotifier {
String? get walletId => _walletId;
Future<void> load({String? walletId}) async {
final targetWalletId = walletId ?? _walletId;
final requestSeq = ++_loadSeq;
_walletId = targetWalletId;
_isLoading = true;
_error = null;
notifyListeners();
try {
_walletId = walletId ?? _walletId;
_transactions = await _service.fetchHistory(walletId: _walletId);
final fetched = await _service.fetchHistory(walletId: targetWalletId);
if (requestSeq != _loadSeq) return;
_transactions = targetWalletId == null
? fetched
: fetched.where((tx) => tx.walletId == targetWalletId).toList();
} catch (e) {
if (requestSeq != _loadSeq) return;
_error = e.toString();
} finally {
_isLoading = false;
notifyListeners();
if (requestSeq == _loadSeq) {
_isLoading = false;
notifyListeners();
}
}
}
}