fix: do not fire pause logic on window focus/blur event
This commit is contained in:
parent
addf9d71fa
commit
52254bca7c
@ -334,6 +334,7 @@ class Collab extends PureComponent<Props, CollabState> {
|
|||||||
if (this.portal.socket) {
|
if (this.portal.socket) {
|
||||||
this.reportActive();
|
this.reportActive();
|
||||||
this.portal.socket.connect();
|
this.portal.socket.connect();
|
||||||
|
this.portal.socketInitialized = true;
|
||||||
this.setIsCollaborationPaused(false);
|
this.setIsCollaborationPaused(false);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
|
@ -476,7 +476,9 @@ const ExcalidrawWrapper = () => {
|
|||||||
event.type === EVENT.FOCUS
|
event.type === EVENT.FOCUS
|
||||||
) {
|
) {
|
||||||
syncData();
|
syncData();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.type === EVENT.VISIBILITY_CHANGE) {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
// user switches to another tab
|
// user switches to another tab
|
||||||
case document.hidden && collabAPI.isCollaborating():
|
case document.hidden && collabAPI.isCollaborating():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user