mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 12:38:24 +00:00
Fix settings initialization bug
This commit is contained in:
+4
-1
@@ -190,7 +190,10 @@ class ScaffoldWithNavigationBar extends HookConsumerWidget {
|
||||
padding: const EdgeInsets.fromLTRB(16, 20, 16, 0),
|
||||
child: initializer.when(
|
||||
data: (_) => body,
|
||||
error: (e, _) => const Text('error'),
|
||||
error: (e, stack) {
|
||||
print(stack);
|
||||
return Text('error $e');
|
||||
},
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -16,10 +16,10 @@ class Settings extends DataModel<Settings> {
|
||||
mixin SettingsAdapter on Adapter<Settings> {
|
||||
@override
|
||||
Future<void> onInitialized() async {
|
||||
await super.onInitialized();
|
||||
// ensure it's always present
|
||||
if (!existsId('_')) {
|
||||
Settings().saveLocal();
|
||||
}
|
||||
super.onInitialized();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user