mirror of
https://github.com/git-touch/git-touch
synced 2024-12-16 18:28:51 +01:00
fix: domain comparison
This commit is contained in:
parent
f2e312079b
commit
b958ddf0cf
@ -11,8 +11,16 @@ class AccountModel {
|
||||
String login;
|
||||
String avatarUrl;
|
||||
|
||||
equals(AccountModel a) =>
|
||||
a.platform == platform && a.domain == domain && a.login == login;
|
||||
equals(AccountModel a) {
|
||||
final uri = Uri.parse(domain);
|
||||
final uriA = Uri.parse(a.domain);
|
||||
|
||||
// Treat domains as the same if they have the same hosts and ports
|
||||
return a.platform == platform &&
|
||||
a.login == login &&
|
||||
uri.host == uriA.host &&
|
||||
uri.port == uriA.port;
|
||||
}
|
||||
|
||||
AccountModel({
|
||||
@required this.platform,
|
||||
|
@ -109,7 +109,7 @@ class SettingsModel with ChangeNotifier {
|
||||
|
||||
await _setAccounts(AccountModel(
|
||||
platform: PlatformType.github,
|
||||
domain: 'github.com',
|
||||
domain: 'https://github.com',
|
||||
token: token,
|
||||
login: queryData['viewer']['login'] as String,
|
||||
avatarUrl: queryData['viewer']['avatarUrl'] as String,
|
||||
|
Loading…
Reference in New Issue
Block a user