Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/RichWorkspace.vue')
-rw-r--r--src/views/RichWorkspace.vue12
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()
+ })
+ }
})
},
},