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
path: root/src
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-12-31 14:15:04 +0300
committerJulius Härtl <jus@bitgrid.net>2020-01-09 20:51:36 +0300
commit7218cdc2f642b7fdb47bc9d840ab19d7e258c9ed (patch)
treefacf44ccd63e9897967afe3145ddde0dad8d8cf8 /src
parentf30f6e54cf1f70398190562fb423ac4c0a4e811c (diff)
Properly handle file deletion and temporary service unavailability
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r--src/components/EditorWrapper.vue10
-rw-r--r--src/services/PollingBackend.js6
-rw-r--r--src/views/RichWorkspace.vue9
3 files changed, 19 insertions, 6 deletions
diff --git a/src/components/EditorWrapper.vue b/src/components/EditorWrapper.vue
index 5b68a390e..5799395c0 100644
--- a/src/components/EditorWrapper.vue
+++ b/src/components/EditorWrapper.vue
@@ -26,11 +26,11 @@
<p v-if="hasSyncCollission" class="msg icon-error">
{{ t('text', 'The document has been changed outside of the editor. The changes cannot be applied.') }}
</p>
- <p v-if="hasConnectionIssue" class="msg icon-error">
- {{ t('text', 'Network connection error: Could not connect to the document') }} <a class="button primary" @click="reconnect">{{ t('text', 'Retry') }}</a>
+ <p v-if="hasConnectionIssue" class="msg icon-info">
+ {{ t('text', 'File could not be loaded. Please check your internet connection.') }} <a class="button primary" @click="reconnect">{{ t('text', 'Retry') }}</a>
</p>
</div>
- <div v-if="currentSession && active" id="editor-wrapper" :class="{'has-conflicts': hasSyncCollission, 'icon-loading': !initialLoading, 'richEditor': isRichEditor}">
+ <div v-if="currentSession && active" id="editor-wrapper" :class="{'has-conflicts': hasSyncCollission, 'icon-loading': !initialLoading || hasConnectionIssue, 'richEditor': isRichEditor}">
<div id="editor">
<MenuBar v-if="!syncError && !readOnly"
ref="menubar"
@@ -369,8 +369,8 @@ export default {
}
if (error === ERROR_TYPE.SOURCE_NOT_FOUND) {
this.initialLoading = false
- OC.Notification.showTemporary('Source not found')
this.$emit('close')
+ this.$emit('error')
}
})
.on('stateChange', (state) => {
@@ -508,7 +508,7 @@ export default {
.msg.icon-error {
padding: 12px;
- border-bottom:1px solid var(--color-error);
+ border-bottom:1px solid var(--color-border);
padding-left: 30px;
background-position: 8px center;
}
diff --git a/src/services/PollingBackend.js b/src/services/PollingBackend.js
index 239f7230a..88e94d264 100644
--- a/src/services/PollingBackend.js
+++ b/src/services/PollingBackend.js
@@ -158,6 +158,12 @@ class PollingBackend {
})
} else if (e.response.status === 403) {
this._authority.emit('error', ERROR_TYPE.CONNECTION_FAILED, {})
+ } else if (e.response.status === 404) {
+ this._authority.emit('error', ERROR_TYPE.SOURCE_NOT_FOUND, {})
+ } else if (e.response.status === 503) {
+ this.increaseRefetchTimer()
+ this._authority.emit('error', ERROR_TYPE.CONNECTION_FAILED, { retry: true })
+ console.error('Failed to fetch steps due to unavailable service', e)
} else {
this.increaseRefetchTimer()
this._authority.emit('error', ERROR_TYPE.CONNECTION_FAILED, { retry: false })
diff --git a/src/views/RichWorkspace.vue b/src/views/RichWorkspace.vue
index 4d3dadbb4..9ccbc79b8 100644
--- a/src/views/RichWorkspace.vue
+++ b/src/views/RichWorkspace.vue
@@ -40,7 +40,8 @@
:autofocus="autofocus"
@ready="ready=true"
@focus="focus=true"
- @blur="focus=false" />
+ @blur="focus=false"
+ @error="reset" />
</div>
</template>
@@ -96,6 +97,12 @@ export default {
})
},
methods: {
+ reset() {
+ this.file = null
+ this.$nextTick(() => {
+ this.getFileInfo()
+ })
+ },
getFileInfo() {
this.loaded = false
this.autofocus = false