Skip to content

Commit

Permalink
Fix showMapMismatchWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
peng-u-0807 committed Aug 30, 2024
1 parent ca5e1a0 commit 921e2f5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ struct LectureDetailScene: View {
}

private var showMapMismatchWarning: Bool {
!lecture.timePlaces.allSatisfy { timeplace in
buildings.allSatisfy {
timeplace.place.hasPrefix($0.number)
}
!lecture.timePlaces.map { $0.place }.allSatisfy { place in
buildings.first(where: { place.hasPrefix($0.number) }) != nil
}
}

Expand All @@ -85,7 +83,7 @@ struct LectureDetailScene: View {
.padding(.vertical, 20)
.padding(.bottom, 40)
}
.onLoad {
.task {
buildings = await viewModel.getBuildingList(of: lecture)
}
.onAppear {
Expand Down Expand Up @@ -436,7 +434,6 @@ struct LectureDetailScene: View {
? STColor.gray30.opacity(0.6)
: STColor.darkGray.opacity(0.6))
.padding(.top, 8)

Spacer()
}
}
Expand Down

0 comments on commit 921e2f5

Please sign in to comment.