fix: persistence

This commit is contained in:
SqrtMinusOne 2022-08-14 17:47:48 +05:00
parent 90e9abcdf5
commit 5cdd5ca82d
2 changed files with 6 additions and 2 deletions

View file

@ -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."

View file

@ -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."