diff options
author | Max <max@nextcloud.com> | 2022-03-03 17:34:27 +0300 |
---|---|---|
committer | Max <max@nextcloud.com> | 2022-03-03 17:54:13 +0300 |
commit | 31fa34280383d29ac517ecc43904be0655017634 (patch) | |
tree | fbf1a432869ceabcd8779511d6ddef93443e17c8 /src | |
parent | 0d7cb5ab7fc3080793e7d91590a6498d5bda1a75 (diff) |
fix: workspace with Readme.md open details.
Do not show the spinning wheel unless the file actually changed.
* Resolves #2215.
* Targets: master.
Opening Readme.md in the sidebar triggers a PROPFIND.
We parse its response just like the initial file list load.
Readme.md is part of the response and our handler attempts to open it.
Only set the vm.ready if the file actually changed.
Only a changed file will make the editor load again.
Only then will it set ready to true and stop the spinning wheel.
Signed-off-by: Max <max@nextcloud.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/helpers/files.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/helpers/files.js b/src/helpers/files.js index d48401950..551670052 100644 --- a/src/helpers/files.js +++ b/src/helpers/files.js @@ -229,12 +229,16 @@ const FilesWorkspacePlugin = { }, open(data) { + const previous = this.vm.file + const id = parseInt(data.id) this.vm.file = { ...data, - id: parseInt(data.id), + id, + } + if (previous?.id !== id) { + // Editor loads new file. Wait for it to be ready. + this.vm.ready = false } - // waiting for the editor to be ready - this.vm.ready = false }, } |