Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions BuildTools/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion BuildTools/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let package = Package(
name: "BuildTools",
platforms: [.macOS(.v10_11)],
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", .exact("0.49.5")),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.49.7"),
],
targets: [.target(name: "BuildTools", path: "")]
)
222 changes: 110 additions & 112 deletions FlowCrypt.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions FlowCrypt/App/AppContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ class AppContextWithUser: AppContext {
)
)

_ = try await self.clientConfigurationService.fetch(for: user)

super.init(
encryptedStorage: encryptedStorage,
session: session,
Expand Down
5 changes: 3 additions & 2 deletions FlowCrypt/Controllers/Compose/ComposeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ final class ComposeViewController: TableNodeViewController {
filesManager: FilesManagerType = FilesManager(),
photosManager: PhotosManagerType = PhotosManager(),
keyMethods: KeyMethodsType = KeyMethods()
) throws {
) async throws {
self.appContext = appContext
self.email = appContext.user.email
self.notificationCenter = notificationCenter
self.input = input
self.decorator = decorator
let clientConfiguration = try appContext.clientConfigurationService.getSaved(for: appContext.user.email)
let clientConfiguration = try await appContext.clientConfigurationService.configuration

self.localContactsProvider = LocalContactsProvider(
encryptedStorage: appContext.encryptedStorage
)
Expand Down
14 changes: 8 additions & 6 deletions FlowCrypt/Controllers/Inbox/InboxViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,14 @@ extension InboxViewController {
}

private func btnComposeTap() {
do {
TapTicFeedback.generate(.light)
let composeVc = try ComposeViewController(appContext: appContext)
navigationController?.pushViewController(composeVc, animated: true)
} catch {
showAlert(message: error.localizedDescription)
Task {
do {
TapTicFeedback.generate(.light)
let composeVc = try await ComposeViewController(appContext: appContext)
navigationController?.pushViewController(composeVc, animated: true)
} catch {
showAlert(message: error.localizedDescription)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ extension MsgListViewController where Self: UIViewController {

// TODO: uncomment in "sent message from draft" feature
private func openDraft(appContext: AppContextWithUser, with message: Message) {
do {
let controller = try ComposeViewController(appContext: appContext)
controller.update(with: message)
navigationController?.pushViewController(controller, animated: true)
} catch {
showAlert(message: error.localizedDescription)
Task {
do {
let controller = try await ComposeViewController(appContext: appContext)
controller.update(with: message)
navigationController?.pushViewController(controller, animated: true)
} catch {
showAlert(message: error.localizedDescription)
}
}
}

Expand All @@ -51,16 +53,18 @@ extension MsgListViewController where Self: UIViewController {
}

private func openThread(with thread: MessageThread, appContext: AppContextWithUser) {
do {
let viewController = try ThreadDetailsViewController(
appContext: appContext,
thread: thread
) { [weak self] (action, message) in
self?.handleMessageOperation(with: message, action: action)
Task {
do {
let viewController = try await ThreadDetailsViewController(
appContext: appContext,
thread: thread
) { [weak self] (action, message) in
self?.handleMessageOperation(with: message, action: action)
}
navigationController?.pushViewController(viewController, animated: true)
} catch {
showAlert(message: error.localizedDescription)
}
navigationController?.pushViewController(viewController, animated: true)
} catch {
showAlert(message: error.localizedDescription)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ final class KeySettingsViewController: TableNodeViewController {
appContext: AppContextWithUser,
decorator: KeySettingsViewDecorator = KeySettingsViewDecorator(),
keyMethods: KeyMethodsType = KeyMethods()
) throws {
) async throws {
self.appContext = appContext
self.decorator = decorator
self.isUsingKeyManager = try appContext.clientConfigurationService.getSaved(for: appContext.user.email).isUsingKeyManager
self.isUsingKeyManager = try await appContext.clientConfigurationService.configuration.isUsingKeyManager
self.keyMethods = keyMethods
super.init(node: TableNode())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ final class SettingsViewController: TableNodeViewController {
init(
appContext: AppContextWithUser,
decorator: SettingsViewDecorator = SettingsViewDecorator()
) throws {
) async throws {
self.appContext = appContext
self.decorator = decorator
self.clientConfiguration = try appContext.clientConfigurationService.getSaved(for: appContext.user.email)
self.clientConfiguration = try await appContext.clientConfigurationService.configuration
self.rows = SettingsMenuItem.filtered(with: clientConfiguration)
super.init(node: TableNode())
}
Expand Down Expand Up @@ -101,20 +101,23 @@ extension SettingsViewController: ASTableDelegate, ASTableDataSource {

func tableNode(_: ASTableNode, didSelectRowAt indexPath: IndexPath) {
let setting = rows[indexPath.row]
proceed(to: setting)

Task {
await proceed(to: setting)
}
}
}

// MARK: - Actions

extension SettingsViewController {
private func proceed(to setting: SettingsMenuItem) {
private func proceed(to setting: SettingsMenuItem) async {
let viewController: UIViewController?

switch setting {
case .keys:
do {
viewController = try KeySettingsViewController(appContext: appContext)
viewController = try await KeySettingsViewController(appContext: appContext)
} catch {
viewController = nil
showAlert(message: error.localizedDescription)
Expand Down
Loading