Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions Sources/SwiftNextcloudUI/Views/ServerAddressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public typealias BeginPollingHandler = (_ url: URL, _ dismiss: @MainActor @Senda
/// - Parameters:
/// - token: The polling token the login flow is identified by uniquely.
///
public typealias CancelPollingHandler = (_ token: String) -> Void
public typealias CancelPollingHandler = () -> Void

///
/// The full screen view in which a user enters the address of the server to log in on.
Expand Down Expand Up @@ -106,11 +106,6 @@ public struct ServerAddressView: View, QRCodeParsing, URLSanitizing {
///
@State var loginAddress: URL?

///
/// The temporarily known token to identify the login flow belonging to this view.
///
@State var pollingToken: String?

// MARK: - Implementation

public var body: some View {
Expand Down Expand Up @@ -277,9 +272,10 @@ public struct ServerAddressView: View, QRCodeParsing, URLSanitizing {
dismiss()
}

if let user {
url.append(queryItems: [URLQueryItem(name: "user", value: user)])
}
// Temporary disabled until https://github.com/nextcloud/server/issues/59874 is resolved.
// if let user {
// url.append(queryItems: [URLQueryItem(name: "user", value: user)])
// }

beginWebView(url)
} catch {
Expand All @@ -302,10 +298,7 @@ public struct ServerAddressView: View, QRCodeParsing, URLSanitizing {
/// - The login completed successfully.
///
func endWebView() {
if let pollingToken {
cancelPolling(pollingToken)
self.pollingToken = nil
}
cancelPolling()

isActive = false
isPresentingWebView = false
Expand Down Expand Up @@ -338,7 +331,7 @@ public struct ServerAddressView: View, QRCodeParsing, URLSanitizing {
} beginPolling: { _, _ in
print("Begin polling!")
return URL(string: "about:blank")!
} cancelPolling: { _ in
} cancelPolling: {
print("Cancel polling!")
}
}
Expand All @@ -355,7 +348,7 @@ public struct ServerAddressView: View, QRCodeParsing, URLSanitizing {
} beginPolling: { _, _ in
print("Begin polling!")
return URL(string: "about:blank")!
} cancelPolling: { _ in
} cancelPolling: {
print("Cancel polling!")
}
}
Expand Down
Loading