diff --git a/DLPrototype.xcodeproj/project.pbxproj b/DLPrototype.xcodeproj/project.pbxproj index e19c1052..a5bfd27e 100644 --- a/DLPrototype.xcodeproj/project.pbxproj +++ b/DLPrototype.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/DLPrototype/Views/Today/LogTable/LogTable.swift b/DLPrototype/Views/Today/LogTable/LogTable.swift index 2e29049f..6fdc8acb 100644 --- a/DLPrototype/Views/Today/LogTable/LogTable.swift +++ b/DLPrototype/Views/Today/LogTable/LogTable.swift @@ -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 { @@ -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 = ""