1
0
Fork 0

- prevented quitting program when users does not input a valid answer at prompt asking for deleting pleroma messages.

This commit is contained in:
cage 2021-09-09 15:15:05 +02:00
parent 5f4789be79
commit 2d03b99e99
1 changed files with 11 additions and 7 deletions

View File

@ -18,7 +18,8 @@
(in-package :ui-goodies) (in-package :ui-goodies)
(defun boolean-input-accepted-p (user-input) (defun boolean-input-accepted-p (user-input)
(string-equal user-input (_ "y"))) (values (string-equal user-input (_ "y"))
(string-not-empty-p user-input)))
(defun open-manual () (defun open-manual ()
#+man-bin #+man-bin
@ -74,12 +75,15 @@
(defun clean-close-program () (defun clean-close-program ()
"Use this to close the program" "Use this to close the program"
(flet ((on-input-complete (maybe-accepted) (flet ((on-input-complete (maybe-accepted)
(if (boolean-input-accepted-p maybe-accepted) (multiple-value-bind (y-pressed-p not-null-input-p)
(let ((delete-event (make-instance 'delete-all-status-event))) (boolean-input-accepted-p maybe-accepted)
(push-event delete-event)) (when not-null-input-p
(db-utils:with-ready-database (:connect nil) (if y-pressed-p
(db:renumber-all-timelines '()))) (let ((delete-event (make-instance 'delete-all-status-event)))
(clean-temporary-files))) (push-event delete-event))
(db-utils:with-ready-database (:connect nil)
(db:renumber-all-timelines '())))
(clean-temporary-files)))))
(let ((delete-count (db:count-status-marked-to-delete)) (let ((delete-count (db:count-status-marked-to-delete))
(stop-download-event (make-instance 'gemini-abort-all-downloading-event (stop-download-event (make-instance 'gemini-abort-all-downloading-event
:priority +maximum-event-priority+))) :priority +maximum-event-priority+)))