From 5e71fdf1cc6fa9718c3f581f866355156491e277 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Fri, 23 Aug 2024 14:09:42 -0400 Subject: [PATCH] Preferences: Fire synctopreference *after* updating preference (#4615) And add a new beforesynctopreference event to replace the old behavior. You almost always want the preference to be updated before acting on the change. --- chrome/content/zotero/preferences/preferences.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index 2d517cf240..b55c9cef04 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -430,8 +430,9 @@ ${str} else { value = elem.value; } - elem.dispatchEvent(new Event('synctopreference')); + elem.dispatchEvent(new Event('beforesynctopreference')); Zotero.Prefs.set(preference, value, true); + elem.dispatchEvent(new Event('synctopreference')); }, /**