@threekit-tools/treble 0.0.65 → 0.0.66

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.
@@ -236,7 +236,8 @@ var loadNewProduct = function (config) {
236
236
  }
237
237
  if (shouldCacheProduct)
238
238
  dispatch((0, exports.cacheActiveProduct)({ label: label, thumbnail: thumbnail }));
239
- dispatch((0, exports.setProductId)(undefined));
239
+ if (config)
240
+ dispatch((0, exports.setProductId)(undefined));
240
241
  return [4 /*yield*/, dispatch((0, treble_1.reloadPlayer)(config))];
241
242
  case 1:
242
243
  _a.sent();
@@ -350,8 +350,8 @@ var unloadPlayer = function () { return function (dispatch) { return __awaiter(v
350
350
  return __generator(this, function (_a) {
351
351
  switch (_a.label) {
352
352
  case 0:
353
- dispatch((0, exports.setThreekitInitialized)(true));
354
- dispatch((0, exports.setPlayerLoading)(false));
353
+ dispatch((0, exports.setThreekitInitialized)(false));
354
+ dispatch((0, exports.setPlayerLoading)(true));
355
355
  dispatch((0, attributes_1.setAttributes)([]));
356
356
  dispatch((0, product_1.setName)(''));
357
357
  dispatch((0, product_1.setMetadata)({}));
@@ -398,18 +398,21 @@ var reloadPlayer = function (config) {
398
398
  trebleConfig = (0, utils_1.loadTrebleConfig)();
399
399
  playerConfig = Object.assign({}, constants_1.DEFAULT_PLAYER_CONFIG, trebleConfig.player);
400
400
  el = document.getElementById(state.treble.playerElId);
401
- if (state.treble.isThreekitInitialized)
402
- dispatch((0, exports.unloadPlayer)());
403
- return [4 /*yield*/, dispatch((0, exports.initPlayer)({
404
- el: el,
405
- orgId: connectionObj.orgId,
406
- authToken: connectionObj.authToken,
407
- stageId: stageId,
408
- assetId: assetId,
409
- playerConfig: playerConfig,
410
- initialConfiguration: initialConfiguration,
411
- }))];
401
+ if (!state.treble.isThreekitInitialized) return [3 /*break*/, 6];
402
+ return [4 /*yield*/, dispatch((0, exports.unloadPlayer)())];
412
403
  case 5:
404
+ _a.sent();
405
+ _a.label = 6;
406
+ case 6: return [4 /*yield*/, dispatch((0, exports.initPlayer)({
407
+ el: el,
408
+ orgId: connectionObj.orgId,
409
+ authToken: connectionObj.authToken,
410
+ stageId: stageId,
411
+ assetId: assetId,
412
+ playerConfig: playerConfig,
413
+ initialConfiguration: initialConfiguration,
414
+ }))];
415
+ case 7:
413
416
  _a.sent();
414
417
  dispatch((0, price_1.updatePrice)());
415
418
  dispatch((0, product_1.initProduct)());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threekit-tools/treble",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "author": "Amaan Saeed",
5
5
  "license": "MIT",
6
6
  "files": [