@xapps-platform/marketplace-ui 0.1.10 → 0.1.11
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/index.js +14 -2
- package/dist/index.js.map +2 -2
- package/dist/pages/WidgetView.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6631,7 +6631,19 @@ function WidgetView() {
|
|
|
6631
6631
|
let alive = true;
|
|
6632
6632
|
void (async () => {
|
|
6633
6633
|
try {
|
|
6634
|
-
const
|
|
6634
|
+
const widgetTokenResponse = await client.getWidgetToken(installationId, widgetId);
|
|
6635
|
+
const resolvedWidgetId = readString(asRecord(widgetTokenResponse).widgetId);
|
|
6636
|
+
if (resolvedWidgetId && resolvedWidgetId !== widgetId) {
|
|
6637
|
+
navigate(
|
|
6638
|
+
{
|
|
6639
|
+
pathname: isEmbedded ? `/widget/${encodeURIComponent(installationId)}/${encodeURIComponent(resolvedWidgetId)}` : `/marketplace/widget/${encodeURIComponent(installationId)}/${encodeURIComponent(resolvedWidgetId)}`,
|
|
6640
|
+
search: tokenSearch
|
|
6641
|
+
},
|
|
6642
|
+
{ replace: true }
|
|
6643
|
+
);
|
|
6644
|
+
return;
|
|
6645
|
+
}
|
|
6646
|
+
const { token: wToken, context } = widgetTokenResponse;
|
|
6635
6647
|
if (!alive) return;
|
|
6636
6648
|
setSessionExpired(null);
|
|
6637
6649
|
setWidgetToken(wToken);
|
|
@@ -6645,7 +6657,7 @@ function WidgetView() {
|
|
|
6645
6657
|
return () => {
|
|
6646
6658
|
alive = false;
|
|
6647
6659
|
};
|
|
6648
|
-
}, [installationId, widgetId, client]);
|
|
6660
|
+
}, [installationId, widgetId, client, isEmbedded, navigate, tokenSearch]);
|
|
6649
6661
|
async function remintWidgetSession() {
|
|
6650
6662
|
if (!installationId || !widgetId) {
|
|
6651
6663
|
throw new Error("Missing installationId/widgetId for widget refresh");
|