Skip to content

Commit a180c19

Browse files
committed
Merge release/2.8.0 into main
2 parents 29f979e + 086124e commit a180c19

File tree

282 files changed

+1730
-1704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+1730
-1704
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ fastlane/Preview.html
4444
fastlane/screenshots/screenshots.html
4545
fastlane/screenshots/*/*.png
4646
fastlane/test_output
47+
48+
# App Store Connect API keys
49+
*.p8
50+
51+
# IAP pricing configs (contain actual prices)
52+
fastlane/config/iap-*.json

Cryptomator.xcodeproj/project.pbxproj

Lines changed: 38 additions & 18 deletions
Large diffs are not rendered by default.

Cryptomator/AddVault/CreateNewVault/CreateNewVaultCoordinator.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import CryptomatorCloudAccessCore
1111
import CryptomatorCommonCore
1212
import UIKit
1313

14-
class CreateNewVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditAccountBehavior, Coordinator {
14+
class CreateNewVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditAccountBehavior, DefaultAccountSelectionBehavior, Coordinator {
1515
var navigationController: UINavigationController
1616
var childCoordinators = [Coordinator]()
1717
weak var parentCoordinator: Coordinator?
@@ -55,9 +55,8 @@ class CreateNewVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditA
5555
}
5656
}
5757

58-
func selectedAccont(_ account: AccountInfo) throws {
59-
let provider = try CloudProviderDBManager.shared.getProvider(with: account.accountUID)
60-
startFolderChooser(with: provider, account: account.cloudProviderAccount)
58+
func proceedWithValidatedAccount(provider: CloudProvider, account: CloudProviderAccount) {
59+
startFolderChooser(with: provider, account: account)
6160
}
6261

6362
private func startFolderChooser(with provider: CloudProvider, account: CloudProviderAccount) {

Cryptomator/AddVault/CreateNewVault/LocalVault/CreateNewLocalVaultViewModel.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ class CreateNewLocalVaultViewModel: LocalFileSystemAuthenticationViewModel, Loca
1616

1717
init(vaultName: String, selectedLocalFileSystemType: LocalFileSystemType, accountManager: CloudProviderAccountManager = CloudProviderAccountDBManager.shared) {
1818
let documentPickerButtonText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.button")
19-
let headerText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.header")
19+
let headerText: String
20+
switch selectedLocalFileSystemType {
21+
case .iCloudDrive:
22+
headerText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.iCloudDrive.header")
23+
case .custom:
24+
headerText = LocalizedString.getValue("localFileSystemAuthentication.createNewVault.otherFileProvider.header")
25+
}
2026
self.vaultName = vaultName
2127
super.init(documentPickerButtonText: documentPickerButtonText, headerText: headerText, selectedLocalFileSystemType: selectedLocalFileSystemType, validationLogic: CreateNewLocalVaultValidationLogic(vaultName: vaultName), accountManager: accountManager)
2228
}

Cryptomator/AddVault/LocalVault/LocalFileSystemAuthenticationViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class LocalFileSystemAuthenticationViewController: SingleSectionStaticUITableVie
3131
}
3232
documentPicker.allowsMultipleSelection = false
3333
documentPicker.delegate = self
34-
documentPicker.directoryURL = viewModel.documentPickerStartDirectoryURL
3534
present(documentPicker, animated: true)
3635
}
3736

Cryptomator/AddVault/LocalVault/LocalFileSystemAuthenticationViewModel.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import Promises
1313

1414
protocol LocalFileSystemAuthenticationViewModelProtocol: SingleSectionTableViewModel {
1515
var headerText: String { get }
16-
var documentPickerStartDirectoryURL: URL? { get }
1716
func footerViewModel(for section: Int) -> HeaderFooterViewModel?
1817
func userPicked(urls: [URL]) throws -> LocalFileSystemCredential
1918
}
@@ -31,16 +30,6 @@ class LocalFileSystemAuthenticationViewModel: SingleSectionTableViewModel, Local
3130
return [openDocumentPickerCellViewModel]
3231
}
3332

34-
var documentPickerStartDirectoryURL: URL? {
35-
switch selectedLocalFileSystemType {
36-
case .iCloudDrive:
37-
return LocalFileSystemAuthenticationViewModel.iCloudDriveRootDirectory
38-
case .custom:
39-
return nil
40-
}
41-
}
42-
43-
static let iCloudDriveRootDirectory = URL(fileURLWithPath: "\(iCloudDrivePrefix)com~apple~CloudDocs/")
4433
private static let iCloudDrivePrefix = "/private/var/mobile/Library/Mobile Documents/"
4534
let documentPickerButtonText: String
4635
let headerText: String

Cryptomator/AddVault/OpenExistingVault/LocalVault/OpenExistingLocalVaultViewModel.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ class OpenExistingLocalVaultViewModel: LocalFileSystemAuthenticationViewModel, L
1515
private let validator: OpenExistingLocalVaultValidationLogic
1616
init(selectedLocalFileSystemType: LocalFileSystemType, accountManager: CloudProviderAccountManager = CloudProviderAccountDBManager.shared) {
1717
let documentPickerButtonText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.button")
18-
let headerText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.header")
18+
let headerText: String
19+
switch selectedLocalFileSystemType {
20+
case .iCloudDrive:
21+
headerText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.iCloudDrive.header")
22+
case .custom:
23+
headerText = LocalizedString.getValue("localFileSystemAuthentication.openExistingVault.otherFileProvider.header")
24+
}
1925
self.validator = OpenExistingLocalVaultValidationLogic()
2026
super.init(documentPickerButtonText: documentPickerButtonText, headerText: headerText, selectedLocalFileSystemType: selectedLocalFileSystemType, validationLogic: validator, accountManager: accountManager)
2127
}

Cryptomator/AddVault/OpenExistingVault/OpenExistingVaultCoordinator.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Foundation
1515
import Promises
1616
import UIKit
1717

18-
class OpenExistingVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditAccountBehavior, Coordinator {
18+
class OpenExistingVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditAccountBehavior, DefaultAccountSelectionBehavior, Coordinator {
1919
var navigationController: UINavigationController
2020
var childCoordinators = [Coordinator]()
2121
weak var parentCoordinator: AddVaultCoordinator?
@@ -56,9 +56,8 @@ class OpenExistingVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEd
5656
}
5757
}
5858

59-
func selectedAccont(_ account: AccountInfo) throws {
60-
let provider = try CloudProviderDBManager.shared.getProvider(with: account.accountUID)
61-
startFolderChooser(with: provider, account: account.cloudProviderAccount)
59+
func proceedWithValidatedAccount(provider: CloudProvider, account: CloudProviderAccount) {
60+
startFolderChooser(with: provider, account: account)
6261
}
6362

6463
private func startFolderChooser(with provider: CloudProvider, account: CloudProviderAccount) {

Cryptomator/Common/CloudAccountList/AccountListViewController.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ class AccountListViewController: ListViewController<AccountCellContent>, ASWebAu
9898
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
9999
tableView.deselectRow(at: indexPath, animated: true)
100100
let accountInfo = viewModel.accountInfos[indexPath.row]
101-
do {
102-
try coordinator?.selectedAccont(accountInfo)
103-
} catch {
104-
coordinator?.handleError(error, for: self)
105-
}
101+
coordinator?.selectedAccount(accountInfo)
106102
}
107103

108104
// MARK: - ASWebAuthenticationPresentationContextProviding
@@ -174,7 +170,10 @@ private class AccountListViewModelMock: AccountListViewModelProtocol {
174170
let accountInfos = [AccountInfo]()
175171
let title = "Google Drive"
176172

177-
func refreshItems() -> Promise<Void> { return Promise(()) }
173+
func refreshItems() -> Promise<Void> {
174+
return Promise(())
175+
}
176+
178177
func moveRow(at sourceIndex: Int, to destinationIndex: Int) throws {}
179178
func removeRow(at index: Int) throws {}
180179
func startListenForChanges(onError: @escaping (Error) -> Void, onChange: @escaping () -> Void) {}

Cryptomator/Common/CloudAccountList/AccountListing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import UIKit
1111

1212
protocol AccountListing: AnyObject {
1313
func showAddAccount(for cloudProviderType: CloudProviderType, from viewController: UIViewController)
14-
func selectedAccont(_ account: AccountInfo) throws
14+
func selectedAccount(_ account: AccountInfo)
1515
func showEdit(for account: AccountInfo)
1616
}

0 commit comments

Comments
 (0)