Skip to content

Commit

Permalink
some logic fixes to make this compile
Browse files Browse the repository at this point in the history
  • Loading branch information
n13 committed Jul 3, 2024
1 parent 71e3df5 commit 0e0cdfd
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:collection/collection.dart';
import 'package:dynamic_parallel_queue/dynamic_parallel_queue.dart';
import 'package:seeds/datasource/remote/api/stat_repository.dart';
Expand Down Expand Up @@ -83,8 +85,8 @@ class GetTokenModelsUseCase extends InputUseCase<List<TokenModel>, TokenModelSel
List<TokenModel?> theseTokens = [];

/// verify token contract on chain and get contract precision
loadData(token) async {
TokenModel? tm = TokenModel.fromJson(token as Map<String, dynamic>);
FutureOr loadData(token) async {
final TokenModel? tm = TokenModel.fromJson(token as Map<String, dynamic>);
if (tm != null) {
await _statRepository.getTokenStat(tokenContract: tm.contract, symbol: tm.symbol).then(
(stats) async {
Expand All @@ -95,7 +97,11 @@ class GetTokenModelsUseCase extends InputUseCase<List<TokenModel>, TokenModelSel
print("supply: $supply");
}
},
).catchError((dynamic error) => _statRepository.mapHttpError(error));
).catchError((dynamic error) {
// This entire code here is really funky - Nik
_statRepository.mapHttpError(error);
return null; // Ensure the handler returns a value assignable to FutureOr<Null>
});
}
}

Expand Down

0 comments on commit 0e0cdfd

Please sign in to comment.