From 0cd1dba25c2e0868b1fc4282fbc6961180574b4e Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Mon, 29 Mar 2021 14:09:13 +0300 Subject: [PATCH] [SSE mobile] Fixed events --- .../mobile/src/controller/Statusbar.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index fc3509e02..87a9a26db 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -17,7 +17,6 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { useEffect(() => { const on_api_created = api => { - api.asc_registerCallback('asc_onCoAuthoringDisconnect', onApiDisconnect); api.asc_registerCallback('asc_onUpdateTabColor', onApiUpdateTabColor); api.asc_registerCallback('asc_onWorkbookLocked', onWorkbookLocked); api.asc_registerCallback('asc_onWorksheetLocked', onWorksheetLocked); @@ -31,16 +30,20 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { } }; - Common.Notifications.on('api:disconnect', onApiDisconnect); Common.Notifications.on('document:ready', onApiSheetsChanged); Common.Notifications.on('engineCreated', on_api_created); $$('.view-main').on('click', on_main_view_click); return () => { - Common.Notifications.off('api:disconnect', onApiDisconnect); Common.Notifications.off('document:ready', onApiSheetsChanged); Common.Notifications.off('engineCreated', on_api_created); + + api.asc_unregisterCallback('asc_onUpdateTabColor', onApiUpdateTabColor); + api.asc_unregisterCallback('asc_onWorkbookLocked', onWorkbookLocked); + api.asc_unregisterCallback('asc_onWorksheetLocked', onWorksheetLocked); + api.asc_unregisterCallback('asc_onSheetsChanged', onApiSheetsChanged); + api.asc_unregisterCallback('asc_onHidePopMenu', onApiHideTabContextMenu); $$('.view-main').off('click', on_main_view_click); }; @@ -99,10 +102,6 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => { }; - const onApiDisconnect = () => { - users.isDisconnected = true; - }; - const onApiUpdateTabColor = index => { loadTabColor(index); };