@vtex/faststore-plugin-buyer-portal 1.1.111 → 1.1.112
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/package.json
CHANGED
|
@@ -31,13 +31,10 @@ export const withAuth = <T extends Record<string, unknown>>(
|
|
|
31
31
|
}
|
|
32
32
|
}, [props?.loading, hasCookie, router]);
|
|
33
33
|
|
|
34
|
-
// If loading (cookie not yet available), show skeleton
|
|
35
|
-
if (props?.loading) {
|
|
36
|
-
return <PageLoader />;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// If not authorized and not loading, render nothing
|
|
40
34
|
if (!props?.authorized) {
|
|
35
|
+
if (props?.loading) {
|
|
36
|
+
return <PageLoader />;
|
|
37
|
+
}
|
|
41
38
|
return null;
|
|
42
39
|
}
|
|
43
40
|
|
|
@@ -34,17 +34,13 @@ export const withAuthProvider = <T,>(
|
|
|
34
34
|
}
|
|
35
35
|
}, [props?.loading, hasCookie, router]);
|
|
36
36
|
|
|
37
|
-
// Se está carregando (cookie ainda não disponível), mostra skeleton
|
|
38
|
-
if (props?.loading) {
|
|
39
|
-
return <PageLoader />;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Se não está autorizado e não está carregando, não renderiza nada
|
|
43
37
|
if (!props?.authorized) {
|
|
38
|
+
if (props?.loading) {
|
|
39
|
+
return <PageLoader />;
|
|
40
|
+
}
|
|
44
41
|
return null;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
// Se autorizado, renderiza o componente envolvido no provider
|
|
48
44
|
return (
|
|
49
45
|
<BuyerPortalProvider clientContext={props?.clientContext}>
|
|
50
46
|
<Component {...props.data} clientContext={props?.clientContext} />
|