Skip to content

Commit

Permalink
Make sure the expired bool in the game code is correctly shown
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Jul 11, 2021
1 parent 934cc43 commit bbdcc14
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/infrastructure/data_service.dart
Expand Up @@ -459,9 +459,11 @@ class DataServiceImpl implements DataService {
final material = _genshinService.getMaterial(reward.itemKey);
return ItemAscensionMaterialModel(quantity: reward.quantity, image: material.image, materialType: material.type);
}).toList();
//I should not be saving the isExpired bool
final expired = e.isExpired || (e.expiredOn?.isBefore(DateTime.now()) ?? false);
return GameCodeModel(
code: e.code,
isExpired: e.isExpired,
isExpired: expired,
expiredOn: e.expiredOn,
discoveredOn: e.discoveredOn,
isUsed: e.usedOn != null,
Expand Down

0 comments on commit bbdcc14

Please sign in to comment.