暫定実装

This commit is contained in:
ろむねこ 2024-07-08 12:22:43 +09:00
parent ac29832038
commit efec0512d2
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168
2 changed files with 8 additions and 3 deletions

View File

@ -30,8 +30,6 @@ public class RewardDataImpl implements RewardData {
@Override
public CompletableFuture<Integer> getTotalReward(String childId) {
return CompletableFuture.supplyAsync(() -> {
return ksActions.syncHistory(childId).join().stream().mapToInt(HistoryModel::getReward).sum();
});
return CompletableFuture.supplyAsync(() -> ksActions.syncHistory(childId).join().stream().mapToInt(HistoryModel::getReward).sum());
}
}

View File

@ -64,10 +64,17 @@ public class WalletContentFragment extends Fragment {
private void updateTotalReward() {
rewardData.getTotalReward(childId).thenAccept(totalReward -> {
logger.debug("Total reward: " + totalReward);
totalRewardTextView.setText(String.valueOf(totalReward));
}).exceptionally(throwable -> {
logger.error("Failed to get total reward: " + throwable.getMessage());
return null;
});
}
@Override
public void onResume() {
super.onResume();
updateTotalReward();
}
}