From 6ceb7f281f292873558609f3d7bfbc84ba96240d Mon Sep 17 00:00:00 2001 From: peng-u-0807 Date: Tue, 13 Aug 2024 22:36:32 +0900 Subject: [PATCH] `.onAppear` -> `.task` --- SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift b/SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift index c6cf12fd..85cae808 100644 --- a/SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift +++ b/SNUTT-2022/SNUTT/Views/Scenes/LectureDetailScene.swift @@ -91,12 +91,10 @@ struct LectureDetailScene: View { .onAppear { isMapViewExpanded = viewModel.shouldOpenLectureMapView() } - .onAppear { - Task { - if let evLecture = await viewModel.getEvLectureInfo(of: lecture) { - lecture.updateEvLecture(to: evLecture) - viewModel.reloadDetailWebView(detailId: evLecture.evLectureId) - } + .task { + if let evLecture = await viewModel.getEvLectureInfo(of: lecture) { + lecture.updateEvLecture(to: evLecture) + viewModel.reloadDetailWebView(detailId: evLecture.evLectureId) } } .onChange(of: isMapViewExpanded) {