diff --git a/lib/consts.dart b/lib/consts.dart index ba330b3..514e7dc 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.25"; + static const VERSION = "1.0.0-beta.26"; static bool UPDATE_AVAILABLE = false; static UpdateChannel UPDATE_CHANNEL = UpdateChannel.beta; diff --git a/lib/data.dart b/lib/data.dart index e487c93..44bc43c 100644 --- a/lib/data.dart +++ b/lib/data.dart @@ -40,6 +40,8 @@ class SessionData { static String DisplayError = ""; static double? TotalPay; static bool ContainsTripTimes = true; + static bool IsSavedData = false; + static String SaveDataType = ""; /// Is true if the try-catch is tripped or if not running on Android static bool isWeb = false; @@ -472,6 +474,8 @@ class SessionData { String cType = reply.headers.value("Content-Type") ?? "application/json"; if (cType == "application/json") { + IsSavedData = true; + SaveDataType = "JSON"; return LoadData(reply.data as Map); } else if (cType == "application/nbt") { print("Data is in NBT Format"); @@ -482,6 +486,8 @@ class SessionData { IsReadOnly = true; isWeb = true; + IsSavedData = true; + SaveDataType = "NBT"; return true; } else return false; diff --git a/lib/pages/WebMainPage.dart b/lib/pages/WebMainPage.dart index 9d18e5f..96914e2 100644 --- a/lib/pages/WebMainPage.dart +++ b/lib/pages/WebMainPage.dart @@ -124,6 +124,14 @@ class _WebMain extends State { Text( "Use the top left menu to show the various pages for the data viewer.", ), + if (SessionData.IsSavedData) + ListTile( + title: Text("You are viewing saved data"), + subtitle: Text( + "This data was saved in the ${SessionData.SaveDataType} format.\n\nThis data is read-only. You will not be able to edit it.", + ), + tileColor: const Color.fromARGB(255, 7, 123, 255), + ), ElevatedButton( onPressed: () async { await showDialog( diff --git a/pubspec.yaml b/pubspec.yaml index ae30ad8..1a363b9 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.25 +version: 1.0.0-beta.26 environment: sdk: ^3.7.2