mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-14 03:32:23 +01:00
minor bug fixes
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:reboot_launcher/src/widget/window_buttons.dart';
|
||||
|
||||
import '../model/fortnite_version.dart';
|
||||
import '../util/generic_controller.dart';
|
||||
import '../util/reboot.dart';
|
||||
import '../util/version_controller.dart';
|
||||
|
||||
class HomePage extends StatefulWidget {
|
||||
@@ -31,16 +32,23 @@ class _HomePageState extends State<HomePage> {
|
||||
late final GenericController<Process?> _serverController;
|
||||
late final GenericController<bool> _startedServerController;
|
||||
late final GenericController<bool> _startedGameController;
|
||||
|
||||
late Future _future;
|
||||
bool _loaded = false;
|
||||
int _index = 0;
|
||||
|
||||
@override
|
||||
void initState(){
|
||||
_future = _load();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
Future<bool> _load() async {
|
||||
if (_loaded) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var preferences = await SharedPreferences.getInstance();
|
||||
await downloadRebootDll(preferences);
|
||||
|
||||
Iterable json = jsonDecode(preferences.getString("versions") ?? "[]");
|
||||
var versions =
|
||||
@@ -103,7 +111,7 @@ class _HomePageState extends State<HomePage> {
|
||||
],
|
||||
trailing: const WindowTitleBar()),
|
||||
content: FutureBuilder(
|
||||
future: _load(),
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
|
||||
Reference in New Issue
Block a user