@@ -334,6 +334,7 @@ class Collab extends PureComponent<Props, CollabState> {
if (this.portal.socket) {
this.reportActive();
this.portal.socket.connect();
+ this.portal.socketInitialized = true;
this.setIsCollaborationPaused(false);
if (callback) {
@@ -476,7 +476,9 @@ const ExcalidrawWrapper = () => {
event.type === EVENT.FOCUS
) {
syncData();
+ }
+ if (event.type === EVENT.VISIBILITY_CHANGE) {
switch (true) {
// user switches to another tab
case document.hidden && collabAPI.isCollaborating():