@colijnit/configurator 261.20.11 → 261.20.12

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.
@@ -561,6 +561,19 @@ class RotationHelper {
561
561
  }
562
562
  }
563
563
 
564
+ class ConfiguratorErrorMessage {
565
+ message;
566
+ safeMessage;
567
+ description;
568
+ safeDescription;
569
+ constructor(message, description) {
570
+ this.message = message;
571
+ if (description) {
572
+ this.description = description;
573
+ }
574
+ }
575
+ }
576
+
564
577
  class ConfiguratorService {
565
578
  showLoader = new Subject();
566
579
  connectionReset = new Subject();
@@ -766,19 +779,6 @@ function notNill(questionPublicationCode) {
766
779
  throw new Error('Function not implemented.');
767
780
  }
768
781
 
769
- class ConfiguratorErrorMessage {
770
- message;
771
- safeMessage;
772
- description;
773
- safeDescription;
774
- constructor(message, description) {
775
- this.message = message;
776
- if (description) {
777
- this.description = description;
778
- }
779
- }
780
- }
781
-
782
782
  class ConfiguratorConnectorService {
783
783
  _appEventService;
784
784
  _settingsService;
@@ -1783,7 +1783,7 @@ class ThreedselectorService {
1783
1783
  c.children = connectors.concat(meshes);
1784
1784
  });
1785
1785
  return resolve(object);
1786
- });
1786
+ }).catch((e) => reject(e));
1787
1787
  }
1788
1788
  catch (e) {
1789
1789
  reject(e);
@@ -1798,6 +1798,10 @@ class ThreedselectorService {
1798
1798
  resolve(obj);
1799
1799
  }).catch(async (e) => {
1800
1800
  DebugUtils.log('downloadAssetsAndReturn: ' + e);
1801
+ // GLB failed, fall back to the legacy JSON model format. The XMLHttpRequest
1802
+ // handlers above settle the promise: onloadend parses the response, onerror rejects.
1803
+ oReq.open('GET', FileUtils.FixUrl(assetPath.replace('.glb.gz', '').replace('.glb', '')), true);
1804
+ oReq.send(null);
1801
1805
  });
1802
1806
  });
1803
1807
  }
@@ -3278,7 +3282,7 @@ class LoadFurnitureBaseService {
3278
3282
  return obj;
3279
3283
  }, err => {
3280
3284
  DebugUtils.log('Error: ' + err);
3281
- return err;
3285
+ return Promise.reject(new ConfiguratorErrorMessage('THREED_MODEL_NOT_FOUND', String(err)));
3282
3286
  });
3283
3287
  // }
3284
3288
  }
@@ -3319,7 +3323,7 @@ class LoadFurnitureBaseService {
3319
3323
  return Promise.reject(configurationResultObject);
3320
3324
  }
3321
3325
  });
3322
- if (obj === null) {
3326
+ if (!obj) { // no model url, or the download failed and onlyThreeD is off
3323
3327
  if (this.settingsService.settings.options.onlyThreeD && this.needs3DModel(configurationResultObject.placement)) {
3324
3328
  configurationResultObject.resultType = ResultType.No3DModel;
3325
3329
  return Promise.reject(configurationResultObject);