From da6e363308ffd72bcc75691d135080fcd732625e Mon Sep 17 00:00:00 2001 From: vixer93 Date: Wed, 11 Sep 2024 00:41:46 +0900 Subject: [PATCH] Fix bug that not display session message --- .../CommonComponents/Timetable/TimetableCard.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app-ios/Sources/CommonComponents/Timetable/TimetableCard.swift b/app-ios/Sources/CommonComponents/Timetable/TimetableCard.swift index 2a8ea7c13..1dd0c54ea 100644 --- a/app-ios/Sources/CommonComponents/Timetable/TimetableCard.swift +++ b/app-ios/Sources/CommonComponents/Timetable/TimetableCard.swift @@ -80,12 +80,16 @@ public struct TimetableCard: View { .lineLimit(1) } } - if let timetableItemSession = timetableItem as? TimetableItem.Session, - let sessionMessage = timetableItemSession.message?.currentLangTitle, - !sessionMessage.isEmpty { + + let message: String? = switch timetableItem { + case let session as TimetableItem.Session: session.message?.currentLangTitle + case let special as TimetableItem.Special: special.message?.currentLangTitle + default: nil + } + if let message, !message.isEmpty { HStack(spacing: 8) { Image(.icInfoFill) - Text(sessionMessage) + Text(message) .textStyle(.bodySmall) .multilineTextAlignment(.leading) .foregroundStyle(AssetColors.Error.error.swiftUIColor)