From 3fd2da9a70075b9555262fc3cd3497ad8cac9531 Mon Sep 17 00:00:00 2001
From: Arkerthan <arkerthan@gmail.com>
Date: Mon, 24 Feb 2020 11:24:07 +0100
Subject: [PATCH] cleanup MainView.error call

---
 src/js/main.js            | 3 +++
 src/uncategorized/main.tw | 8 ++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/js/main.js b/src/js/main.js
index d10426230a8..01d409520d4 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -1,3 +1,6 @@
+/**
+ * @returns {DocumentFragment}
+ */
 App.MainView.errors = function() {
 	const fragment = document.createDocumentFragment();
 
diff --git a/src/uncategorized/main.tw b/src/uncategorized/main.tw
index 9df0275706a..7abfe0e6712 100644
--- a/src/uncategorized/main.tw
+++ b/src/uncategorized/main.tw
@@ -1,11 +1,11 @@
 :: Main [nobr]
 
-/* this way we can apply auto fixes before the rest of the passage */
-<<set _errors = App.Main.errors()>>
+/* make sure the first thing that happens is the error check */
+<<set _errors = App.MainView.errors()>>
 <span id="errors"></span>
 <<script>>
-	$(document).one(':passageend', function (ev) {
-		$('#errors').append(App.MainView.errors());
+	$(document).one(':passagerender', event => {
+		event.content.prepend(State.temporary.errors);
 	});
 <</script>>
 
-- 
GitLab