Fix load app from cache
This commit is contained in:
parent
b1063f5057
commit
7b05ed2a4a
5 changed files with 19 additions and 13 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue