From 5cdd5ca82d8ec6a4ddb0a53dc6f15b9e619f23bd Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sun, 14 Aug 2022 17:47:48 +0500 Subject: [PATCH] fix: persistence --- pomm-third-time.el | 4 +++- pomm.el | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pomm-third-time.el b/pomm-third-time.el index 1b3f53e..e8e4361 100644 --- a/pomm-third-time.el +++ b/pomm-third-time.el @@ -145,7 +145,9 @@ This is an alist with the following keys: (if (not (string-empty-p data)) (setq pomm-third-time--state (car (read-from-string data))) (pomm-third-time--do-reset))))) - (pomm-third-time--cleanup-old-history)) + (pomm-third-time--cleanup-old-history) + (when (eq (alist-get 'status pomm-third-time--state) 'running) + (setq pomm--timer (run-with-timer 0 1 #'pomm-third-time--on-tick)))) (defun pomm-third-time--save-state () "Save the current Third Time timer state." diff --git a/pomm.el b/pomm.el index 415d5b2..8e15542 100644 --- a/pomm.el +++ b/pomm.el @@ -272,7 +272,9 @@ start of the timer." (if (not (string-empty-p data)) (setq pomm--state (car (read-from-string data))) (pomm--do-reset))))) - (pomm--cleanup-old-history)) + (pomm--cleanup-old-history) + (when (eq (alist-get 'status pomm--state) 'running) + (setq pomm--timer (run-with-timer 0 1 #'pomm--on-tick)))) (defun pomm--save-state () "Save the current Pomodoro timer state."