Skip to content

Commit

Permalink
moved record-to-string conversion to a method so I can call it in
Browse files Browse the repository at this point in the history
multiple places and change the ordering in changeSort
  • Loading branch information
aapis committed Apr 17, 2023
1 parent cb196e0 commit 88ae579
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DLPrototype.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 85;
CURRENT_PROJECT_VERSION = 86;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"DLPrototype/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
Expand Down Expand Up @@ -1016,7 +1016,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 85;
CURRENT_PROJECT_VERSION = 86;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"DLPrototype/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
Expand Down
10 changes: 10 additions & 0 deletions DLPrototype/Views/Today/LogTable/LogTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ struct LogTable: View, Identifiable {
LogRowEmpty(message: "No records found for today", index: 0, colour: Theme.rowColour)
}
}
.onChange(of: selectedTab, perform: { _ in
changeSort()
})
}

var tableDetails: some View {
Expand All @@ -242,11 +245,18 @@ struct LogTable: View, Identifiable {
} else if selectedTab == 1 {
records = grouped()
}

createPlaintextRecords()
}

private func loadRecordsBySelectedDate() -> Void {
records = LogRecords(moc: moc).forDate(selectedDate)

// TODO: move this func to LogRecords model
createPlaintextRecords()
}

private func createPlaintextRecords() -> Void {
if records.count > 0 {
recordsAsString = ""

Expand Down

0 comments on commit 88ae579

Please sign in to comment.