Fix load app from cache

This commit is contained in:
zontreck 2025-05-25 13:45:17 -07:00
parent b1063f5057
commit 7b05ed2a4a
5 changed files with 19 additions and 13 deletions

View file

@ -327,6 +327,10 @@ class SessionData {
await _deserialize(ct);
if (IsOnTheClock) ContainsTripTimes = true;
Calls.dispatch();
return true;
}
@ -338,13 +342,20 @@ class SessionData {
static Future<void> _deserialize(CompoundTag ct) async {
IsOnTheClock = NbtUtils.readBoolean(ct, "inprog");
if (IsOnTheClock) {
await Login();
}
StartTime = DateTime.parse(ct.get("start")!.asString());
if (ct.containsKey("end")) {
EndTime = DateTime.parse(ct.get("end")!.asString());
} else {
EndTime = DateTime(0);
}
TotalPay = ct.get("totalPay")!.asDouble();
if (ct.containsKey("totalPay")) {
TotalPay = ct.get("totalPay")!.asDouble();
}
ListTag poses = ct.get("pos")! as ListTag;
for (var pos in poses.value) {