Last lint fix

This commit is contained in:
shilangyu 2021-04-11 00:28:33 +02:00
parent bb8e5ee525
commit 709f357368
1 changed files with 10 additions and 22 deletions

View File

@ -97,29 +97,9 @@ class AccountsStore extends ChangeNotifier {
}
}
String? get defaultUsername {
// if (defaultAccount == null) {
// return null;
// }
String? get defaultUsername => defaultAccount?.split('@')[0];
return defaultAccount?.split('@')[0];
}
String? get defaultInstanceHost {
// if (defaultAccount == null) {
// return null;
// }
return defaultAccount?.split('@')[1];
}
String? defaultUsernameFor(String instanceHost) {
if (isAnonymousFor(instanceHost)) {
return null;
}
return defaultAccounts[instanceHost];
}
String? get defaultInstanceHost => defaultAccount?.split('@')[1];
Jwt? get defaultToken {
if (defaultAccount == null) {
@ -130,6 +110,14 @@ class AccountsStore extends ChangeNotifier {
return tokens[userTag[1]]?[userTag[0]];
}
String? defaultUsernameFor(String instanceHost) {
if (isAnonymousFor(instanceHost)) {
return null;
}
return defaultAccounts[instanceHost];
}
Jwt? defaultTokenFor(String instanceHost) {
if (isAnonymousFor(instanceHost)) {
return null;