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 var twitterIsActive: Bool = false
AccountManager.shared.accounts.forEach({ account in AccountManager.shared.accounts.forEach({ account in
account.flattenedWebFeeds().forEach({ webfeed in if account.type == .cloudKit || account.type == .onMyMac {
guard let components = URLComponents(string: webfeed.url), account.flattenedWebFeeds().forEach({ webfeed in
let host = components.host else { guard let components = URLComponents(string: webfeed.url),
return let host = components.host else {
} return
if host == "twitter.com" { }
twitterIsActive = true if host == "twitter.com" {
return twitterIsActive = true
} return
}) }
})
}
}) })
if twitterIsActive { if twitterIsActive {
showTwitterDeprecationAlert() showTwitterDeprecationAlert()