new: add support of some exception panel with zero usage

This commit is contained in:
Hiddify
2023-10-01 16:25:07 +02:00
parent e5e8d645a7
commit a7e157c036

View File

@@ -159,14 +159,13 @@ class SubscriptionInfo with _$SubscriptionInfo {
}
int _fromJsonTotal(dynamic total) {
if (total == null) {
return 9223372036854775807;
}
return total as int;
final totalInt = total as int? ?? -1;
return totalInt > 0 ? totalInt : 9223372036854775807;
}
DateTime _dateTimeFromSecondsSinceEpoch(dynamic expire) {
final expireInt = expire as int? ?? -1;
return DateTime.fromMillisecondsSinceEpoch(
(expire as int? ?? 92233720368) * 1000,
(expireInt > 0 ? expireInt : 92233720368) * 1000,
);
}