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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum WorkspaceScope {
let descriptor = FetchDescriptor<Workspace>(
predicate: #Predicate { $0.id == id && $0.deletedAt == nil }
)
return (try? context.fetch(descriptor).first) ?? fallback
return context.fetchOrLog(descriptor).first ?? fallback
}

static func creationTarget(raw: String, workspaces: [Workspace]) -> Workspace? {
Expand Down
2 changes: 1 addition & 1 deletion CalenTask/Features/Projects/TaskDeepLinkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ struct TaskDeepLinkView: View {
predicate: #Predicate { $0.id == id && $0.deletedAt == nil }
)
descriptor.fetchLimit = 1
return try? modelContext.fetch(descriptor).first
return modelContext.fetchOrLog(descriptor).first
}
}
2 changes: 1 addition & 1 deletion CalenTask/Features/Projects/Views/ProjectBoardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ private struct BoardColumn: View {

private func fetchTask(_ id: UUID) -> TodoTask? {
let descriptor = FetchDescriptor<TodoTask>(predicate: #Predicate { $0.id == id })
return try? modelContext.fetch(descriptor).first
return modelContext.fetchOrLog(descriptor).first
}

private func addTask() {
Expand Down
2 changes: 1 addition & 1 deletion CalenTask/Features/Projects/Views/ProjectKanbanView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private struct KanbanColumn: View {
private func handleDrop(_ items: [String], before target: TodoTask? = nil) -> Bool {
guard let raw = items.first, let id = UUID(uuidString: raw) else { return false }
let descriptor = FetchDescriptor<TodoTask>(predicate: #Predicate<TodoTask> { $0.id == id })
guard let task = try? modelContext.fetch(descriptor).first,
guard let task = modelContext.fetchOrLog(descriptor).first,
task.id != target?.id else { return false }
withAnimation(.dsSoft) {
switch mode {
Expand Down
Loading