From 1f97f36e1ccded9a1cab1e777427cfea0cff4964 Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 7 Jul 2020 13:17:25 +0200 Subject: [PATCH 1/3] After Store: Correctly handle preloaded HTML --- src/boot/after_store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 1796eb1b..d9f2da78 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -29,7 +29,7 @@ const preloadFetch = async (request) => { return { ok: true, json: () => JSON.parse(requestData), - text: () => requestData + text: () => JSON.parse(requestData) } } From f7f8181dcf5d2a699c0d870bd8873cbe7784a6af Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 7 Jul 2020 14:46:53 +0300 Subject: [PATCH 2/3] fix preview opening automatically --- src/components/post_status_form/post_status_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index daadc10f..62e0d7e4 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -227,7 +227,7 @@ const PostStatusForm = { el.style.height = 'auto' el.style.height = undefined this.error = null - this.previewStatus() + if (this.preview) this.previewStatus() } else { this.error = data.error } From 7c9ba8995ca49c0fa4eb987467bc1aab13fc67f3 Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 7 Jul 2020 11:47:01 +0000 Subject: [PATCH 3/3] Apply suggestion to src/boot/after_store.js --- src/boot/after_store.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/boot/after_store.js b/src/boot/after_store.js index d9f2da78..47524112 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -25,11 +25,11 @@ const preloadFetch = async (request) => { if (!data || !data[request]) { return window.fetch(request) } - const requestData = atob(data[request]) + const requestData = JSON.parse(atob(data[request])) return { ok: true, - json: () => JSON.parse(requestData), - text: () => JSON.parse(requestData) + json: () => requestData, + text: () => requestData } }