Update version
This commit is contained in:
@@ -39,10 +39,15 @@ class CategoryRepository: ObservableObject {
|
||||
]
|
||||
|
||||
do {
|
||||
self.categories = try self.context.fetch(request)
|
||||
let fetched = try self.context.fetch(request)
|
||||
DispatchQueue.main.async {
|
||||
self.categories = fetched
|
||||
}
|
||||
} catch {
|
||||
print("Failed to fetch categories: \(error)")
|
||||
self.categories = []
|
||||
DispatchQueue.main.async {
|
||||
self.categories = []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,10 +40,15 @@ class GoalRepository: ObservableObject {
|
||||
]
|
||||
|
||||
do {
|
||||
self.goals = try self.context.fetch(request)
|
||||
let fetched = try self.context.fetch(request)
|
||||
DispatchQueue.main.async {
|
||||
self.goals = fetched
|
||||
}
|
||||
} catch {
|
||||
print("Failed to fetch goals: \(error)")
|
||||
self.goals = []
|
||||
DispatchQueue.main.async {
|
||||
self.goals = []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,10 +41,15 @@ class InvestmentSourceRepository: ObservableObject {
|
||||
]
|
||||
|
||||
do {
|
||||
self.sources = try self.context.fetch(request)
|
||||
let fetched = try self.context.fetch(request)
|
||||
DispatchQueue.main.async {
|
||||
self.sources = fetched
|
||||
}
|
||||
} catch {
|
||||
print("Failed to fetch sources: \(error)")
|
||||
self.sources = []
|
||||
DispatchQueue.main.async {
|
||||
self.sources = []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user