From 94d4b187ef9543d3a4c19ad3ce4f4f213be89d19 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 18 Jul 2024 13:22:10 +0100 Subject: [PATCH] UX: Show error when checkbox change fails (#27968) e.g. due to a permissions/network issue --- .../assets/javascripts/discourse/initializers/checklist.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js b/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js index 06bc4f5c49a..02d1f658cf8 100644 --- a/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js +++ b/plugins/checklist/assets/javascripts/discourse/initializers/checklist.js @@ -1,4 +1,5 @@ import { ajax } from "discourse/lib/ajax"; +import { popupAjaxError } from "discourse/lib/ajax-error"; import { withPluginApi } from "discourse/lib/plugin-api"; import { iconHTML } from "discourse-common/lib/icon-library"; import I18n from "discourse-i18n"; @@ -154,6 +155,8 @@ export function checklistSyntax(elem, postDecorator) { postWidget.attrs.isSaving = false; postWidget.scheduleRerender(); + } catch (e) { + popupAjaxError(e); } finally { boxes.forEach((e) => e.classList.remove("readonly")); box.classList.remove("hidden");