Skip to content

Commit

Permalink
Merge pull request #889 from Infomaniak/fix-activity-url
Browse files Browse the repository at this point in the history
fix(UserActivityController): Create URL without Endpoint struct to prevent encode issues
  • Loading branch information
PhilippeWeidmann committed Jul 19, 2023
2 parents 8831e3e + 34e7c45 commit d5ed5c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions MailCore/API/Endpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ public extension Endpoint {
return Endpoint(hostKeypath: \.mailHost, path: "/api")
}

static func currentUserActivity(mailboxIndex: Int, folder: Folder) -> Endpoint {
return Endpoint(hostKeypath: \.mailHost, path: "/\(mailboxIndex);fid=\(folder.id)")
}

static var mailboxes: Endpoint {
return .base.appending(
path: "/mailbox",
Expand Down
2 changes: 1 addition & 1 deletion MailCore/Utils/UserActivityController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class UserActivityController {

currentActivity?.invalidate()
currentActivity = activity
currentActivity?.webpageURL = Endpoint.currentUserActivity(mailboxIndex: mailboxIndex, folder: folder).url
currentActivity?.webpageURL = URL(string: "https://\(ApiEnvironment.current.mailHost)/\(mailboxIndex);fid=\(folder.id)")
currentActivity?.becomeCurrent()
}

Expand Down

0 comments on commit d5ed5c8

Please sign in to comment.