From 1d112ba2ffd9861b9c1b1402cd6d365dabeb4e98 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 3 Dec 2024 14:24:26 +0800 Subject: [PATCH] Dirtily adapt to new nk sessions implementation upstream Signed-off-by: Claudio Cambra --- .../Interface/NextcloudKit+RemoteInterface.swift | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift b/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift index 488fa35..f2a11c1 100644 --- a/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift +++ b/Sources/NextcloudFileProviderKit/Interface/NextcloudKit+RemoteInterface.swift @@ -13,11 +13,15 @@ import NextcloudKit extension NextcloudKit: RemoteInterface { public var account: Account { - Account( - user: nkCommonInstance.user, - id: nkCommonInstance.userId, - serverUrl: nkCommonInstance.urlBase, - password: nkCommonInstance.password + guard let session = nkCommonInstance.nksessions.first else { + return Account(user: "", id: "", serverUrl: "", password: "") + } + + return Account( + user: session.user, + id: session.userId, + serverUrl: session.urlBase, + password: session.password ) }