Skip to content

Commit 921e2f5

Browse files
committed
Fix showMapMismatchWarning
1 parent ca5e1a0 commit 921e2f5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ struct LectureDetailScene: View {
5555
}
5656

5757
private var showMapMismatchWarning: Bool {
58-
!lecture.timePlaces.allSatisfy { timeplace in
59-
buildings.allSatisfy {
60-
timeplace.place.hasPrefix($0.number)
61-
}
58+
!lecture.timePlaces.map { $0.place }.allSatisfy { place in
59+
buildings.first(where: { place.hasPrefix($0.number) }) != nil
6260
}
6361
}
6462

@@ -85,7 +83,7 @@ struct LectureDetailScene: View {
8583
.padding(.vertical, 20)
8684
.padding(.bottom, 40)
8785
}
88-
.onLoad {
86+
.task {
8987
buildings = await viewModel.getBuildingList(of: lecture)
9088
}
9189
.onAppear {
@@ -436,7 +434,6 @@ struct LectureDetailScene: View {
436434
? STColor.gray30.opacity(0.6)
437435
: STColor.darkGray.opacity(0.6))
438436
.padding(.top, 8)
439-
440437
Spacer()
441438
}
442439
}

0 commit comments

Comments
 (0)