@threekit-tools/treble 0.0.48 → 0.0.49

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.
@@ -35,18 +35,20 @@ var Player = function (props) {
35
35
  minHeight: '600px',
36
36
  width: '100%',
37
37
  }, props), height = _a.height, width = _a.width, minHeight = _a.minHeight, children = _a.children;
38
- var hasMoved = (0, react_1.useRef)(false);
39
38
  var _b = (0, usePlayerPortal_1.default)(), portalPlayerTo = _b[0], portalBack = _b[1];
39
+ var hasMoved = (0, react_1.useRef)(false);
40
40
  (0, react_1.useEffect)(function () {
41
41
  if (portalPlayerTo && !hasMoved.current) {
42
42
  portalPlayerTo(exports.PLAYER_DIV_ID);
43
43
  hasMoved.current = true;
44
44
  }
45
45
  return function () {
46
- if (portalBack)
46
+ if (portalBack) {
47
47
  portalBack();
48
+ hasMoved.current = false;
49
+ }
48
50
  };
49
- });
51
+ }, [portalPlayerTo]);
50
52
  return (react_1.default.createElement(player_styles_1.Wrapper, { height: height, width: width, minHeight: minHeight, className: className },
51
53
  react_1.default.createElement("div", { id: exports.PLAYER_DIV_ID }),
52
54
  children));
@@ -26,7 +26,6 @@ var usePlayerPortal = function () {
26
26
  htmlElements.current.playerWrapper.appendChild(htmlElements.current.player);
27
27
  };
28
28
  var returnPlayer = function () {
29
- constants_1.TK_PLAYER_LOADER_DIV;
30
29
  if (!htmlElements.current.player)
31
30
  htmlElements.current.player = document.getElementById(playerElementId);
32
31
  if (!htmlElements.current.playerLoader)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threekit-tools/treble",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "author": "Amaan Saeed",
5
5
  "license": "MIT",
6
6
  "files": [