Adds account type check for Twitter deprecation alert

This commit is contained in:
Stuart Breckenridge 2023-02-05 21:30:44 +08:00
parent da91548875
commit b83345a47f
No known key found for this signature in database
GPG Key ID: 64DCE361D27B805B
1 changed files with 12 additions and 10 deletions

View File

@ -965,16 +965,18 @@ internal extension AppDelegate {
var twitterIsActive: Bool = false
AccountManager.shared.accounts.forEach({ account in
account.flattenedWebFeeds().forEach({ webfeed in
guard let components = URLComponents(string: webfeed.url),
let host = components.host else {
return
}
if host == "twitter.com" {
twitterIsActive = true
return
}
})
if account.type == .cloudKit || account.type == .onMyMac {
account.flattenedWebFeeds().forEach({ webfeed in
guard let components = URLComponents(string: webfeed.url),
let host = components.host else {
return
}
if host == "twitter.com" {
twitterIsActive = true
return
}
})
}
})
if twitterIsActive {
showTwitterDeprecationAlert()