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/components/EditorWrapper.vue')
-rw-r--r--src/components/EditorWrapper.vue20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/components/EditorWrapper.vue b/src/components/EditorWrapper.vue
index 0f606378c..f9edfa48b 100644
--- a/src/components/EditorWrapper.vue
+++ b/src/components/EditorWrapper.vue
@@ -305,14 +305,24 @@ export default {
this.document = document
})
.on('error', (error, data) => {
+ this.tiptap.setOptions({ editable: false })
if (error === ERROR_TYPE.SAVE_COLLISSION && (!this.syncError || this.syncError.type !== ERROR_TYPE.SAVE_COLLISSION)) {
this.initialLoading = true
this.syncError = {
- type: ERROR_TYPE.SAVE_COLLISSION,
+ type: error,
data: data
}
- this.tiptap.setOptions({ editable: false })
-
+ }
+ if (error === ERROR_TYPE.CONNECTION_FAILED) {
+ this.initialLoading = false
+ // FIXME: ideally we just try to reconnect in the service, so we don't loose steps
+ OC.Notification.showTemporary('Connection failed, reconnecting')
+ this.reconnect()
+ }
+ if (error === ERROR_TYPE.SOURCE_NOT_FOUND) {
+ this.initialLoading = false
+ OC.Notification.showTemporary('Source not found')
+ this.$emit('close')
}
})
.on('stateChange', (state) => {
@@ -335,6 +345,10 @@ export default {
resolveUseServerVersion() {
this.forceRecreate = true
+ this.reconnect()
+ },
+
+ reconnect() {
this.syncService.close()
this.syncService = null
this.tiptap.destroy()