From 44488558dc29f88ccf15a293a06a1f025119e289 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 28 Aug 2024 15:37:58 +0200 Subject: [PATCH 1/2] fix(editor): Pass onCreate callback to editor API Makes sure that reader content is updated with editor content on initial load. Depends on https://github.com/nextcloud/text/pull/6274. Signed-off-by: Jonas --- src/mixins/editorMixin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mixins/editorMixin.js b/src/mixins/editorMixin.js index 78426bd4e..80b3f27e4 100644 --- a/src/mixins/editorMixin.js +++ b/src/mixins/editorMixin.js @@ -151,6 +151,9 @@ export default { readOnly: false, shareToken: this.shareTokenParam || null, autofocus: false, + onCreate: ({ markdown }) => { + this.updateEditorContentDebounced(markdown) + }, onLoaded: () => { this.done('editor') }, From 1e4716a42168df0d61d1bd67fc0ae449a998fa8f Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 28 Aug 2024 15:39:16 +0200 Subject: [PATCH 2/2] fix(pageContent): Add cache buster param to DAV request Enures that we always get the latest DAV content and nobody (neither browser nor server) cache anything in between. Fixes: #1437 Signed-off-by: Jonas --- src/mixins/pageContentMixin.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mixins/pageContentMixin.js b/src/mixins/pageContentMixin.js index 4390e1bad..4f6970a15 100644 --- a/src/mixins/pageContentMixin.js +++ b/src/mixins/pageContentMixin.js @@ -22,13 +22,16 @@ export default { * @param {string} davUrl URL to fetch page via DAV */ async fetchPageContent(davUrl) { + // Add `timestamp` as cache buster param + const axiosConfig = { + params: { + timestamp: Math.floor(Date.now() / 1000), + }, + } // Authenticate via share token for public shares - let axiosConfig = {} if (this.isPublic) { - axiosConfig = { - auth: { - username: this.shareTokenParam, - }, + axiosConfig.auth = { + username: this.shareTokenParam, } }