From 6493d0dec1cc311ade347327c2b8f9656779abba Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 8 May 2023 19:52:00 +0200 Subject: semi-refactor mastodon-profile--toggle-account-key --- lisp/mastodon-profile.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 8c55155..68d74df 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -394,11 +394,10 @@ Current settings are fetched from the server." (mastodon-profile--get-source-value key) (mastodon-profile--get-json-value key))) (prompt (format "Account setting %s is %s. Toggle?" key val))) - (if val - (when (y-or-n-p prompt) - (mastodon-profile--update-preference (symbol-name key) "false" source)) - (when (y-or-n-p prompt) - (mastodon-profile--update-preference (symbol-name key) "true" source))))) + (when (y-or-n-p prompt) + (mastodon-profile--update-preference (symbol-name key) + (if val "false" "true") + source)))) (defun mastodon-profile--edit-string-value (key) "Edit the string for account preference KEY." -- cgit v1.2.3