make it so that the first instance after instalation is lemmy.ml
This commit is contained in:
parent
cb801a327e
commit
8211d963a7
|
@ -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: [
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue