[SSE mobile] Fixed events
This commit is contained in:
parent
b774db3255
commit
0cd1dba25c
|
@ -17,7 +17,6 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(props => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const on_api_created = api => {
|
const on_api_created = api => {
|
||||||
api.asc_registerCallback('asc_onCoAuthoringDisconnect', onApiDisconnect);
|
|
||||||
api.asc_registerCallback('asc_onUpdateTabColor', onApiUpdateTabColor);
|
api.asc_registerCallback('asc_onUpdateTabColor', onApiUpdateTabColor);
|
||||||
api.asc_registerCallback('asc_onWorkbookLocked', onWorkbookLocked);
|
api.asc_registerCallback('asc_onWorkbookLocked', onWorkbookLocked);
|
||||||
api.asc_registerCallback('asc_onWorksheetLocked', onWorksheetLocked);
|
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('document:ready', onApiSheetsChanged);
|
||||||
Common.Notifications.on('engineCreated', on_api_created);
|
Common.Notifications.on('engineCreated', on_api_created);
|
||||||
|
|
||||||
$$('.view-main').on('click', on_main_view_click);
|
$$('.view-main').on('click', on_main_view_click);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
Common.Notifications.off('api:disconnect', onApiDisconnect);
|
|
||||||
Common.Notifications.off('document:ready', onApiSheetsChanged);
|
Common.Notifications.off('document:ready', onApiSheetsChanged);
|
||||||
Common.Notifications.off('engineCreated', on_api_created);
|
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);
|
$$('.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 => {
|
const onApiUpdateTabColor = index => {
|
||||||
loadTabColor(index);
|
loadTabColor(index);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue