From 29bba94ab8db82a90abfe7531d397016c9c95e12 Mon Sep 17 00:00:00 2001 From: opficdev Date: Fri, 27 Feb 2026 00:50:22 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20pendingTask=EA=B0=80=20=EC=A1=B4?= =?UTF-8?q?=EC=9E=AC=ED=95=98=EB=A9=B4=20=EB=B0=94=EB=A1=9C=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EC=8B=9C=ED=82=A4=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=95=98=EC=97=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DevLog/Presentation/ViewModel/TodoListViewModel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DevLog/Presentation/ViewModel/TodoListViewModel.swift b/DevLog/Presentation/ViewModel/TodoListViewModel.swift index 287e672..73e5746 100644 --- a/DevLog/Presentation/ViewModel/TodoListViewModel.swift +++ b/DevLog/Presentation/ViewModel/TodoListViewModel.swift @@ -181,12 +181,17 @@ private extension TodoListViewModel { case .setShowEditor(let value): state.showEditor = value case .swipeTodo(let todo): + var effects: [SideEffect] = [] + if let (pendingItem, _) = state.pendingTask { + effects = [.delete(pendingItem.id)] + } guard let index = state.todos.firstIndex(where: { $0.id == todo.id }) else { return [] } state.pendingTask = (todo, index) state.todos.remove(at: index) setToast(&state, isPresented: true) + return effects case .tapFilterOption(let option): state.filterOption = option case .tapTogglePinned(let todo):