@urso/core 0.7.71 → 0.7.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@urso/core",
3
- "version": "0.7.71",
3
+ "version": "0.7.73",
4
4
  "description": "HTML5 game engine",
5
5
  "main": "build/js/index.js",
6
6
  "author": "Megbrimef",
@@ -324,7 +324,9 @@ class ModulesScenesPixiWrapper {
324
324
  * reserve loop, when browser tab is inactive
325
325
  * @param {Boolean} isVisible
326
326
  */
327
- _visibilityChangeHandler(isVisible) {
327
+ _visibilityChangeHandler(state) {
328
+ const isVisible = state === 'visible';
329
+
328
330
  if (isVisible) {
329
331
  if (this.passiveCallIntervalId) {
330
332
  clearInterval(this.passiveCallIntervalId);
@@ -15,7 +15,7 @@ class ModulesTransportService {
15
15
  };
16
16
 
17
17
  send(message) {
18
- if (!this._checkCommunicator() || !this._checkCommunicatorReady())
18
+ if (!this._checkCommunicatorReady())
19
19
  return false;
20
20
 
21
21
  const decoratedMessage = this.getInstance('Decorator', { callbacks: this._callbacks }).toServer(message);
@@ -36,7 +36,7 @@ class ModulesTransportService {
36
36
  };
37
37
 
38
38
  reconnect() {
39
- if (!this._checkCommunicator())
39
+ if (!this._checkCommunicatorReady())
40
40
  return false;
41
41
 
42
42
  this._communicator.reconnect(this._getAutoReconnetionDelay());
@@ -45,7 +45,7 @@ class ModulesTransportService {
45
45
  };
46
46
 
47
47
  close() {
48
- if (!this._checkCommunicator())
48
+ if (!this._checkCommunicatorReady())
49
49
  return false;
50
50
 
51
51
  this._communicator.close();
@@ -62,14 +62,11 @@ class ModulesTransportService {
62
62
  return result;
63
63
  };
64
64
 
65
- _checkCommunicator() {
66
- if (!this._communicator)
67
- Urso.logger.error('Communicator was not created!');
68
-
69
- return true;
70
- }
71
-
72
65
  _checkCommunicatorReady() {
66
+ if (!this._communicator) {
67
+ Urso.logger.error('Communicator was not created!');
68
+ return false;
69
+ }
73
70
  return this._communicator.readyCheck();
74
71
  };
75
72