diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-06-26 10:12:19 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-06-26 10:12:19 +0300 |
commit | 4b3c40bf7502ffd45278265caaa733140d1fadb8 (patch) | |
tree | 2a7dd50dcbd2edaee902628a91b2628f2d1ce0bb /src | |
parent | d2333a049f116eae2f0511645521b86a9329fc9e (diff) |
Check if a file was created manually before creating a new rich workspace
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/views/RichWorkspace.vue | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/views/RichWorkspace.vue b/src/views/RichWorkspace.vue index e700ec7bf..eef934b2f 100644 --- a/src/views/RichWorkspace.vue +++ b/src/views/RichWorkspace.vue @@ -129,12 +129,13 @@ export default { if (IS_PUBLIC) { params.shareToken = this.shareToken } - axios.get(WORKSPACE_URL, { params }).then((response) => { + return axios.get(WORKSPACE_URL, { params }).then((response) => { const data = response.data.ocs.data this.folder = data.folder || null this.file = data.file this.editing = true this.loaded = true + return true }).catch((error) => { const data = error.response.data.ocs.data this.folder = data.folder || null @@ -142,6 +143,7 @@ export default { this.loaded = true this.ready = true this.creating = false + return false }) }, createNew() { @@ -149,9 +151,13 @@ export default { return } this.creating = true - window.FileList.createFile('Readme.md', { scrollTo: false, animate: false }).then((status, data) => { - this.getFileInfo() + this.getFileInfo().then((workspaceFileExists) => { this.autofocus = true + if (!workspaceFileExists) { + window.FileList.createFile('Readme.md', { scrollTo: false, animate: false }).then((status, data) => { + this.getFileInfo() + }) + } }) }, }, |