Skip to content

Commit 6c08d03

Browse files
committed
added new 'Error_Messages' postmessage
- handle App_LoadingStatus Initialized - using Error_Messages richdocuments can pass custom error msg to collabora with nextcloud documentation link Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>
1 parent 331f8f7 commit 6c08d03

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/view/Office.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export default {
222222
})
223223
}
224224
this.postMessage.registerPostMessageHandler(this.postMessageHandler)
225+
this.sendPostMessage('Error_Messages', { websocketconnectionfailed: t('Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy might be misconfigured, please contact the administrator. For more info on proxy configuration please checkout https://docs.nextcloud.com/server/latest/admin_manual/office/proxy.html') })
225226
226227
this.load()
227228
},
@@ -308,6 +309,14 @@ export default {
308309
} else if (args.Status === 'Failed') {
309310
this.loading = LOADING_STATE.FAILED
310311
this.$emit('update:loaded', true)
312+
} else if (args.Status === 'Initialized') {
313+
// collabora iframe is ready to handle postMessages
314+
this.sendPostMessage('Error_Messages', {
315+
websocketconnectionfailed: {
316+
msg: t('richdocuments', 'Failed to load {productName} - socket connection closed unexpectedly. The reverse proxy might be misconfigured, please contact the administrator. For more info on proxy configuration please checkout', { productName: loadState('richdocuments', 'productName', 'Nextcloud Office') }) + ' %url',
317+
url: 'https://docs.nextcloud.com/server/latest/admin_manual/office/proxy.html',
318+
},
319+
})
311320
}
312321
break
313322
case 'Action_Load_Resp':

0 commit comments

Comments
 (0)