aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-transient.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@disroot.org>2024-11-02 17:34:59 +0100
committermarty hiatt <martianhiatus@disroot.org>2024-11-02 17:34:59 +0100
commit31557be472a94b48163a5651640d3e807a6cbdf2 (patch)
treee0d49b36275a56b400f2f8e3d3f380e3325dbada /lisp/mastodon-transient.el
parent76234781213518efa44b90b09c2792753a555e09 (diff)
parent6242db6028ef5646ead41e915dec6b8f014e33f8 (diff)
Merge branch 'develop'
Diffstat (limited to 'lisp/mastodon-transient.el')
-rw-r--r--lisp/mastodon-transient.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el
index c96e1d5..3e8ba5f 100644
--- a/lisp/mastodon-transient.el
+++ b/lisp/mastodon-transient.el
@@ -268,8 +268,12 @@ Do not add more than the server's maximum setting."
(transient-define-prefix mastodon-create-poll ()
"A transient for creating a poll."
- ;; FIXME: handle existing polls when editing a toot
- :value (lambda () tp-transient-settings)
+ :value (lambda ()
+ ;; we set `tp-transient-settings' here to the poll value poss
+ ;; pulled from the server by
+ ;; `mastodon-toot--server-poll-to-local'. when we are done with
+ ;; the transient, we set `mastodon-toot-poll' again
+ (setq tp-transient-settings mastodon-toot-poll))
["Create poll"
(:info (lambda ()
(format "Max options: %s"
@@ -305,11 +309,11 @@ Do not add more than the server's maximum setting."
"Clear current poll data."
:transient 'transient--do-stay
(interactive)
- (mastodon-toot--clear-poll)
+ (mastodon-toot--clear-poll :transient)
(transient-reset))
(transient-define-suffix mastodon-create-poll-done (args)
- "Update current user profile fields."
+ "Finish setting poll details."
:transient 'transient--do-exit
(interactive (list (transient-args 'mastodon-create-poll)))
(let* ((options (cl-member-if (lambda (x)
@@ -335,7 +339,9 @@ Do not add more than the server's maximum setting."
(call-interactively #'mastodon-create-poll)
;; if we are called with no poll data, do not set:
(unless (not vals)
- (setq tp-transient-settings
+ ;; we set `mastodon-toot-poll' here not `tp-transient-settings'
+ ;; as that is our var outside of our transient:
+ (setq mastodon-toot-poll
(tp-bools-to-strs args)))
(mastodon-toot--update-status-fields))))