aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-transient.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@disroot.org>2024-11-02 15:40:19 +0100
committermarty hiatt <martianhiatus@disroot.org>2024-11-02 15:40:19 +0100
commitb47390993bc5b16c8b671b006f971c8dd3097395 (patch)
tree66b62a5ec473eb98b2f0a771aebed082dd02ecf8 /lisp/mastodon-transient.el
parent1606b34c5d3fa214df0a2c14445672e12a7cdac1 (diff)
parentf1bdef0b734fef63aeb4854b2a87503d442bd4ec (diff)
Merge branch 'poll-var' into develop
Diffstat (limited to 'lisp/mastodon-transient.el')
-rw-r--r--lisp/mastodon-transient.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/mastodon-transient.el b/lisp/mastodon-transient.el
index c96e1d5..6b1296f 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,7 +309,7 @@ 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)
@@ -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))))