make it so that the first instance after instalation is lemmy.ml

This commit is contained in:
krawieck 2020-12-04 13:55:40 +01:00
parent cb801a327e
commit 8211d963a7
2 changed files with 2 additions and 6 deletions

View File

@ -23,10 +23,6 @@ Future<void> main() async {
final accountsStore = AccountsStore();
await accountsStore.load();
if (accountsStore.instances.isEmpty) {
accountsStore.addInstance('lemmy.ml');
}
runApp(
MultiProvider(
providers: [

View File

@ -30,8 +30,8 @@ class AccountsStore extends ChangeNotifier {
// I barely understand what I did. Long story short it casts a
// raw json into a nested ObservableMap
nestedMapsCast<T>(T f(Map<String, dynamic> json)) => HashMap.of(
(jsonDecode(prefs.getString(SharedPrefKeys.tokens) ?? '{}')
as Map<String, dynamic>)
(jsonDecode(prefs.getString(SharedPrefKeys.tokens) ??
'{"lemmy.ml":{}}') as Map<String, dynamic>)
?.map(
(k, e) => MapEntry(
k,