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: 4 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@ large_tuple:
warning: 4
error: 6

type_body_length:
warning: 300
error: 400

switch_case_alignment:
indented_cases: true
4 changes: 0 additions & 4 deletions iOCNotes/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,7 @@ final class Store: Logging, Storing {
KeychainHelper.syncOnStart = newValue
}
}
}

// MARK: - ServerAddressViewDelegate

extension Store: ServerAddressViewDelegate {
private func getResponse(endpoint: URL, token: String, options: NKRequestOptions) async -> (url: String, user: String, appPassword: String)? {
logger.debug("Getting login flow status...")

Expand Down
17 changes: 12 additions & 5 deletions iOCNotes/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,18 @@ struct ContentView: View {

var body: some View {
if store.accounts.isEmpty {
ServerAddressView(backgroundColor: .constant(Color.accent), brandImage: Image("BrandLogo"), delegate: store, sharedAccounts: sharedAccounts, userAgent: userAgent)
.onAppear {
// The store must update its list of shared accounts when the login user interface is about to appear.
store.readSharedAccounts()
}
ServerAddressView(backgroundColor: .constant(Color.accent), brandImage: Image("BrandLogo"), sharedAccounts: sharedAccounts, userAgent: userAgent) { host, name, password in
store.addAccount(host: host, name: name, password: password)
} beginPolling: { url, _ in
try await store.beginPolling(at: url)
} cancelPolling: { token in
store.cancelPolling(by: token)
}
.onAppear {
// The store must update its list of shared accounts when the login user interface is about to appear.
store.readSharedAccounts()
}

} else {
TabView(selection: $selection) {
NavigationStack {
Expand Down
Loading