Open strike in browser (IOS-264)
This commit is contained in:
parent
5371ad54bf
commit
2d97d67657
|
@ -143,7 +143,7 @@ extension DataSourceFacade {
|
|||
else {
|
||||
return
|
||||
}
|
||||
let mentions = status.entity.mentions ?? []
|
||||
let mentions = status.entity.mentions
|
||||
|
||||
guard let mention = mentions.first(where: { $0.url == href }) else {
|
||||
_ = provider.coordinator.present(
|
||||
|
|
|
@ -44,7 +44,13 @@ extension UITableViewDelegate where Self: DataSourceProvider & AuthContextProvid
|
|||
status: status
|
||||
)
|
||||
} else if let accountWarning = notification.entity.accountWarning {
|
||||
print("// show account warning \(accountWarning.id) in safari")
|
||||
let url = Mastodon.API.disputesEndpoint(domain: authContext.mastodonAuthenticationBox.domain, strikeId: accountWarning.id)
|
||||
_ = coordinator.present(
|
||||
scene: .safari(url: url),
|
||||
from: self,
|
||||
transition: .safariPresent(animated: true, completion: nil)
|
||||
)
|
||||
|
||||
} else {
|
||||
await DataSourceFacade.coordinateToProfileScene(
|
||||
provider: self,
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright © 2024 Mastodon gGmbH. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
|
||||
extension Mastodon.API {
|
||||
public static func disputesEndpoint(domain: String, strikeId: String) -> URL {
|
||||
return Mastodon.API.webURL(domain: domain).appendingPathComponent("disputes/strikes/\(strikeId)")
|
||||
}
|
||||
}
|
|
@ -99,6 +99,10 @@ extension Mastodon.API {
|
|||
public static func profileSettingsURL(domain: String) -> URL {
|
||||
return URL(string: "\(URL.httpScheme(domain: domain))://" + domain + "/auth/edit")!
|
||||
}
|
||||
|
||||
public static func webURL(domain: String) -> URL {
|
||||
return URL(string: "\(URL.httpScheme(domain: domain))://" + domain + "/")!
|
||||
}
|
||||
}
|
||||
|
||||
extension Mastodon.API {
|
||||
|
|
Loading…
Reference in New Issue