File tree Expand file tree Collapse file tree
Feed/Presentation/FeedDetail/ViewModel
MyProfile/Presentation/ViewModel
OtherProfile/Presentation/ViewModel Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,8 +241,8 @@ final class CommentViewModel: ObservableObject {
241241 func onDeleteTapped( commentId: Int ) {
242242 dismissMenu ( )
243243 pendingDeleteCommentId = commentId
244- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
245- self . showDeleteAlert = true
244+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) { [ weak self ] in
245+ self ? . showDeleteAlert = true
246246 }
247247 }
248248
@@ -280,16 +280,16 @@ final class CommentViewModel: ObservableObject {
280280
281281 dismissAction ( )
282282 let capturedInfo = info
283- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
284- self . navigationRouter. navigate ( to: . report( target: . comment( id: commentId) , commentInfo: capturedInfo) )
283+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) { [ weak self ] in
284+ self ? . navigationRouter. navigate ( to: . report( target: . comment( id: commentId) , commentInfo: capturedInfo) )
285285 }
286286 }
287287
288288 func onBlockTapped( comment: Comment ) {
289289 dismissMenu ( )
290290 pendingBlockComment = comment
291- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
292- self . showBlockAlert = true
291+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) { [ weak self ] in
292+ self ? . showBlockAlert = true
293293 }
294294 }
295295
Original file line number Diff line number Diff line change @@ -243,8 +243,8 @@ final class FeedDetailViewModel: ObservableObject {
243243 }
244244
245245 func onDeleteTapped( ) {
246- showAlertAfterDismissingMenu {
247- self . showDeleteAlert = true
246+ showAlertAfterDismissingMenu { [ weak self ] in
247+ self ? . showDeleteAlert = true
248248 }
249249 }
250250
@@ -275,8 +275,8 @@ final class FeedDetailViewModel: ObservableObject {
275275 }
276276
277277 func onBlockTapped( ) {
278- showAlertAfterDismissingMenu {
279- self . showBlockAlert = true
278+ showAlertAfterDismissingMenu { [ weak self ] in
279+ self ? . showBlockAlert = true
280280 }
281281 }
282282
Original file line number Diff line number Diff line change @@ -174,14 +174,10 @@ final class ProfileSettingViewModel: ObservableObject {
174174 Task {
175175 do {
176176 let isDuplicated = try await profileRepository. checkNicknameDuplicate ( nickname: nickname)
177- DispatchQueue . main. async {
178- self . nicknameCheckStatus = isDuplicated ? . duplicated : . available
179- }
177+ self . nicknameCheckStatus = isDuplicated ? . duplicated : . available
180178 } catch {
181- DispatchQueue . main. async {
182- self . errorMessage = " 닉네임 중복확인 실패: \( error. localizedDescription) "
183- self . nicknameCheckStatus = . none
184- }
179+ self . errorMessage = " 닉네임 중복확인 실패: \( error. localizedDescription) "
180+ self . nicknameCheckStatus = . none
185181 }
186182 }
187183 }
Original file line number Diff line number Diff line change @@ -168,8 +168,8 @@ final class OtherProfileViewModel: ObservableObject {
168168
169169 func onBlockTapped( ) {
170170 dismissBlockMenu ( )
171- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) {
172- self . showBlockAlert = true
171+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 0.3 ) { [ weak self ] in
172+ self ? . showBlockAlert = true
173173 }
174174 }
175175
You can’t perform that action at this time.
0 commit comments