diff --git a/src/drive/web/modules/views/OnlyOffice/useConfig.jsx b/src/drive/web/modules/views/OnlyOffice/useConfig.jsx index 1aeef963fd..811f3a2e94 100644 --- a/src/drive/web/modules/views/OnlyOffice/useConfig.jsx +++ b/src/drive/web/modules/views/OnlyOffice/useConfig.jsx @@ -79,6 +79,13 @@ const useConfig = () => { public_name }) + const onWarning = event => { + // sessionIdle + if (event.data.warningCode === -121) { + window.location.reload() + } + } + const serverUrl = onlyoffice.url const apiUrl = `${serverUrl}/web-apps/apps/api/documents/api.js` const docEditorConfig = { @@ -92,7 +99,8 @@ const useConfig = () => { token: onlyoffice.token, documentType: onlyoffice.documentType, events: { - onAppReady: () => setIsEditorReady(true) + onAppReady: () => setIsEditorReady(true), + onWarning } }