@thefittingroom/shop-ui 3.0.0-alpha-6 → 3.0.0-alpha-7
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/dist/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* thefittingroom v3.0.0-alpha-
|
|
2
|
+
* thefittingroom v3.0.0-alpha-7 (2025-04-18T19:07:37.264Z)
|
|
3
3
|
* Copyright 2022-present, TheFittingRoom, Inc. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
function loadImageRecursive(imageURL, imageURLs) {
|
|
@@ -26651,6 +26651,7 @@ var L = {
|
|
|
26651
26651
|
EnterPhoneNumber: 'Enter your number for download link',
|
|
26652
26652
|
FailedToLoadLocale: 'Something went wrong when fetching another language.',
|
|
26653
26653
|
ForgotPasswordWithSymbol: 'Forgot password?',
|
|
26654
|
+
GetVirtualTryOnFramesErrorText: 'The try-on request timed out. Please try again!',
|
|
26654
26655
|
HaveAcc: 'Have an account? Sign in',
|
|
26655
26656
|
Loading: 'Loading...',
|
|
26656
26657
|
LoadingAvatar: 'Your avatar is loading...',
|
|
@@ -28118,14 +28119,26 @@ class FittingRoom {
|
|
|
28118
28119
|
async onTryOnClick(styleId, sizeId, shouldDisplay = true) {
|
|
28119
28120
|
if (!this.vtoComponent)
|
|
28120
28121
|
return console.error('VtoComponent is not initialized');
|
|
28121
|
-
|
|
28122
|
-
|
|
28123
|
-
|
|
28124
|
-
|
|
28125
|
-
|
|
28122
|
+
try {
|
|
28123
|
+
const frames = await this.shop.tryOn(styleId, sizeId);
|
|
28124
|
+
if (shouldDisplay) {
|
|
28125
|
+
try {
|
|
28126
|
+
this.vtoComponent.init();
|
|
28127
|
+
this.vtoComponent.onNewFramesReady(frames);
|
|
28128
|
+
}
|
|
28129
|
+
catch (e) {
|
|
28130
|
+
console.error('Error initializing VTO:', e);
|
|
28131
|
+
this.tfrModal.onError(L.SomethingWentWrong);
|
|
28132
|
+
}
|
|
28126
28133
|
}
|
|
28127
|
-
|
|
28128
|
-
|
|
28134
|
+
}
|
|
28135
|
+
catch (error) {
|
|
28136
|
+
console.error('Error during try-on:', error);
|
|
28137
|
+
if (error instanceof Error && error.name === 'TimeoutError') {
|
|
28138
|
+
this.tfrModal.onError(L.GetVirtualTryOnFramesErrorText);
|
|
28139
|
+
}
|
|
28140
|
+
else {
|
|
28141
|
+
this.tfrModal.onError(L.SomethingWentWrong);
|
|
28129
28142
|
}
|
|
28130
28143
|
}
|
|
28131
28144
|
}
|