From 9fc57bd05654b87c5947e49d4652e3dcf1070c39 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 29 Sep 2018 11:30:07 +0000 Subject: [PATCH] Reload tasks when pressing 'r' --- src/TaskMachine/UI/Behaviors.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/TaskMachine/UI/Behaviors.hs b/src/TaskMachine/UI/Behaviors.hs index a8358e3..5a76d7a 100644 --- a/src/TaskMachine/UI/Behaviors.hs +++ b/src/TaskMachine/UI/Behaviors.hs @@ -44,6 +44,10 @@ taskEditBehavior edit s e = do B.continue s{taskEdit=Just newEdit} taskListBehavior :: UIState -> VTY.Event -> NewState +-- Reload while running +taskListBehavior s (VTY.EvKey (VTY.KChar 'r') []) = do + newState <- liftIO $ loadTasks s + B.continue newState -- Mark/unmark a task as completed taskListBehavior s (VTY.EvKey (VTY.KChar 'x') []) = undefined s -- Delete tasks