Skip to content

Commit

Permalink
feat: add loadingMessage() to show different loadingMsg
Browse files Browse the repository at this point in the history
Signed-off-by: Rashesh Padia <[email protected]>
  • Loading branch information
Rash419 committed Nov 20, 2023
1 parent 81fc84a commit 02f6fbc
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div v-if="showLoadingIndicator"
class="office-viewer__loading-overlay"
:class="{ debug: debug }">
<NcEmptyContent v-if="!error" :title="t('richdocuments', 'Loading {filename} …', { filename: basename }, 1, {escape: false})">
<NcEmptyContent v-if="!error" :title="loadingMessage">
<template #icon>
<NcLoadingIcon />
</template>
Expand Down Expand Up @@ -153,6 +153,7 @@ export default {
loading: LOADING_STATE.LOADING,
loadingTimeout: null,
error: null,
loadingMsg: null,
views: [],

showLinkPicker: false,
Expand Down Expand Up @@ -186,6 +187,13 @@ export default {
return this.error
}
},
loadingMessage() {
if (this.loadingMsg) {
return t('richdocuments', this.loadingMsg)
} else {
return t('richdocuments', 'Loading {filename} …', { filename: basename(this.filename) }, 1, {escape: false})
}
},
debug() {
return !!window.TESTING
},
Expand Down Expand Up @@ -320,8 +328,13 @@ export default {
if (args.success) {
this.documentReady()
} else {
this.error = args.errorMsg
this.loading = LOADING_STATE.FAILED
if (args.errorType === 'clusterscaling') {
this.loadingMsg = args.errorMsg
} else {
this.error = args.errorMsg
this.loading = LOADING_STATE.FAILED
clearTimeout(this.loadingTimeout)
}
}
break
case 'UI_Close':
Expand Down

0 comments on commit 02f6fbc

Please sign in to comment.