Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FunctionCall to finish Loading #180

Merged
merged 1 commit into from
May 24, 2024
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: 3 additions & 1 deletion Services/OrgService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class OrgService: ObservableObject {
self.errorService = errors
}

// Wasn't getting called before -> Never leaving loading state.
// For now called when retrieveOrganisations also called
// Maybe move getCode into the retrieve Func?
func getOrganisation() {
let locallyCachedOrganization = retrieveFromDisk()
self.organization = locallyCachedOrganization
Expand All @@ -33,7 +36,6 @@ class OrgService: ObservableObject {
let org = try await self.retrieveOrganisation()
DispatchQueue.main.async {
self.organization = org

self.loadingState = .finished(Date())
}
} catch {
Expand Down
1 change: 1 addition & 0 deletions Shared/Navigational Structure/LeftSidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ struct LeftSidebarView: View {
if let organization = try? await orgService.retrieveOrganisation() {
DispatchQueue.main.async {
orgService.organization = organization
orgService.getOrganisation()
}
}
}
Expand Down
Loading