Skip to content

Commit

Permalink
Do not reconfigure file provider extension account if we are receivin…
Browse files Browse the repository at this point in the history
…g the same details again

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
  • Loading branch information
claucambra committed Feb 5, 2024
1 parent e4475a6 commit 83e327b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ extension FileProviderExtension: NSFileProviderServicing {
}

@objc func setupDomainAccount(user: String, serverUrl: String, password: String) {
ncAccount = NextcloudAccount(user: user, serverUrl: serverUrl, password: password)
let newNcAccount = NextcloudAccount(user: user, serverUrl: serverUrl, password: password)
guard newNcAccount != ncAccount else { return }
ncAccount = newNcAccount
ncKit.setup(user: ncAccount!.username,
userId: ncAccount!.username,
password: ncAccount!.password,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Foundation
import FileProvider

class NextcloudAccount: NSObject {
struct NextcloudAccount: Equatable {
static let webDavFilesUrlSuffix: String = "/remote.php/dav/files/"
let username, password, ncKitAccount, serverUrl, davFilesUrl: String

Expand All @@ -25,8 +25,6 @@ class NextcloudAccount: NSObject {
self.ncKitAccount = user + " " + serverUrl
self.serverUrl = serverUrl
self.davFilesUrl = serverUrl + NextcloudAccount.webDavFilesUrlSuffix + user

super.init()
}
}

0 comments on commit 83e327b

Please sign in to comment.