From 6ce75d38248be4db993c0ffd3c3ae3f8767d6832 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 1 Aug 2022 10:56:41 +0200 Subject: [PATCH] DEV: dom clean should be cancelled on aborted transition (#17736) --- .../discourse/app/initializers/clean-dom-on-route-change.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/app/initializers/clean-dom-on-route-change.js b/app/assets/javascripts/discourse/app/initializers/clean-dom-on-route-change.js index e7f02766588..41d841f8d0e 100644 --- a/app/assets/javascripts/discourse/app/initializers/clean-dom-on-route-change.js +++ b/app/assets/javascripts/discourse/app/initializers/clean-dom-on-route-change.js @@ -40,6 +40,10 @@ export default { const router = container.lookup("router:main"); router.on("routeDidChange", (transition) => { + if (transition.isAborted) { + return; + } + scheduleOnce("afterRender", container, _clean, transition); }); },