From 596203378b3f959612646645a7740f8553d0514d Mon Sep 17 00:00:00 2001 From: zontreck Date: Sun, 25 May 2025 14:05:43 -0700 Subject: [PATCH] Fix being unable to load NBT in web viewer --- lib/consts.dart | 2 +- lib/data.dart | 4 ++++ pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/consts.dart b/lib/consts.dart index 6da94be..126e9c5 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -9,7 +9,7 @@ class TTConsts { static get SESSION_SERVER => "https://api.zontreck.com/timetrack/$UPDATE_CHANNEL/timetrack.php"; - static const VERSION = "1.0.0-beta.19"; + static const VERSION = "1.0.0-beta.20"; static bool UPDATE_AVAILABLE = false; static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta; diff --git a/lib/data.dart b/lib/data.dart index b9a2ef6..92d4ea1 100644 --- a/lib/data.dart +++ b/lib/data.dart @@ -358,6 +358,7 @@ class SessionData { } ListTag poses = ct.get("pos")! as ListTag; + positions.clear(); for (var pos in poses.value) { positions.add(await SmallPosition.fromNBT(pos.asCompoundTag())); } @@ -461,6 +462,9 @@ class SessionData { // Convert this to a CompoundTag CompoundTag ct = await NbtIo.readFromStream(lst) as CompoundTag; _deserialize(ct); + + IsReadOnly = true; + isWeb = true; return true; } else return false; diff --git a/pubspec.yaml b/pubspec.yaml index e8174c1..ffbe8b8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0-beta.19 +version: 1.0.0-beta.20 environment: sdk: ^3.7.2