mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-22 23:26:37 +00:00
parent
04e1a24551
commit
6e58bb8e3e
1 changed files with 8 additions and 2 deletions
|
@ -62,9 +62,15 @@ public class RouterPath: ObservableObject {
|
|||
}
|
||||
|
||||
public func handleStatus(status: AnyStatus, url: URL) -> OpenURLAction.Result {
|
||||
if url.pathComponents.count == 3 && url.pathComponents[1] == "tags",
|
||||
if url.pathComponents.count == 3 && url.pathComponents[1] == "tags" &&
|
||||
url.host() == status.account.url?.host(),
|
||||
let tag = url.pathComponents.last
|
||||
{
|
||||
// OK this test looks weird but it's
|
||||
// A 3 component path i.e. ["/", "tags", "tagname"]
|
||||
// That is on the same host as the person that posted the tag,
|
||||
// i.e. not a link that matches the pattern but elsewhere on the internet
|
||||
// In those circumstances, hijack the link and goto the tags page instead
|
||||
|
||||
navigate(to: .hashTag(tag: tag, account: nil))
|
||||
return .handled
|
||||
|
|
Loading…
Reference in a new issue