diff --git a/lib/consts.dart b/lib/consts.dart index 2081a39..c978894 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -1,3 +1,3 @@ class Consts { - static const VERSION = "1.1.112324.1559"; + static const VERSION = "1.1.112324.1636"; } diff --git a/lib/pages/ModManager.dart b/lib/pages/ModManager.dart index ac3754f..14b6867 100644 --- a/lib/pages/ModManager.dart +++ b/lib/pages/ModManager.dart @@ -28,7 +28,9 @@ class ModManagerState extends State { M.enabled = false; } - setState(() {}); + setState(() { + settings.restartRequired = true; + }); }, icon: Icon(Icons.swipe_down)), IconButton( @@ -37,7 +39,9 @@ class ModManagerState extends State { M.enabled = true; } - setState(() {}); + setState(() { + settings.restartRequired = true; + }); }, icon: Icon(Icons.swipe_up)) ], @@ -64,11 +68,10 @@ class ModManagerState extends State { settings.inst!.mods[i] = settings.inst!.mods[i - 1]; } settings.inst!.mods[newIndex] = item; - - settings.restartRequired = true; } setState(() { settings.Write(); + settings.restartRequired = true; }); }, itemBuilder: (ctx, idx) { diff --git a/lib/pages/home.dart b/lib/pages/home.dart index d51d3d3..d079616 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -122,15 +122,17 @@ class HomePageState extends State { ListTile( title: Text("Save Changes"), subtitle: Text( - "This will upload the settings to the server and trigger a restart"), + "This will upload the settings to the server and trigger a restart (If required)"), onTap: () async { Settings settings = Settings(); C2SUploadSettingsPacket upload = C2SUploadSettingsPacket(); upload.srvSettings = settings.serialize(); - upload.performRestart = requireRestart; + upload.performRestart = + requireRestart || settings.restartRequired; - await settings.client!.send(upload, !requireRestart); + await settings.client!.send(upload, + settings.restartRequired ? false : !requireRestart); Settings.Clear(); setState(() {}); diff --git a/pubspec.yaml b/pubspec.yaml index 4ed6ef1..b7ade11 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.1.112324+1559 +version: 1.1.112324+1636 environment: sdk: ">=3.1.4 <4.0.0"