@aws-amplify/ui-react-core 3.6.5 → 3.6.6
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/Authenticator/hooks/useAuthenticatorInitMachine/useAuthenticatorInitMachine.mjs
CHANGED
|
@@ -7,7 +7,11 @@ function useAuthenticatorInitMachine(data) {
|
|
|
7
7
|
const { route, initializeMachine } = useAuthenticator(routeSelector);
|
|
8
8
|
const hasInitialized = React__default.useRef(false);
|
|
9
9
|
React__default.useEffect(() => {
|
|
10
|
-
|
|
10
|
+
// `setup` is the usual route on first render, but signing out before the
|
|
11
|
+
// `Authenticator` is rendered moves the machine past setup on its own. Send
|
|
12
|
+
// `INIT` on any route other than `idle`, which resolves the current user
|
|
13
|
+
// before the machine can accept it.
|
|
14
|
+
if (!hasInitialized.current && route !== 'idle') {
|
|
11
15
|
initializeMachine(data);
|
|
12
16
|
hasInitialized.current = true;
|
|
13
17
|
}
|
package/dist/index.js
CHANGED
|
@@ -598,7 +598,11 @@ function useAuthenticatorInitMachine(data) {
|
|
|
598
598
|
const { route, initializeMachine } = useAuthenticator(routeSelector);
|
|
599
599
|
const hasInitialized = React__namespace["default"].useRef(false);
|
|
600
600
|
React__namespace["default"].useEffect(() => {
|
|
601
|
-
|
|
601
|
+
// `setup` is the usual route on first render, but signing out before the
|
|
602
|
+
// `Authenticator` is rendered moves the machine past setup on its own. Send
|
|
603
|
+
// `INIT` on any route other than `idle`, which resolves the current user
|
|
604
|
+
// before the machine can accept it.
|
|
605
|
+
if (!hasInitialized.current && route !== 'idle') {
|
|
602
606
|
initializeMachine(data);
|
|
603
607
|
hasInitialized.current = true;
|
|
604
608
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react-core",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.6",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"typecheck": "tsc --noEmit"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@aws-amplify/ui": "6.15.
|
|
43
|
+
"@aws-amplify/ui": "6.15.6",
|
|
44
44
|
"@xstate/react": "^3.2.2",
|
|
45
45
|
"lodash": "4.18.1",
|
|
46
46
|
"react-hook-form": "7.53.2",
|
|
@@ -14,7 +14,11 @@ export default function useAuthenticatorInitMachine(
|
|
|
14
14
|
|
|
15
15
|
const hasInitialized = React.useRef(false);
|
|
16
16
|
React.useEffect(() => {
|
|
17
|
-
|
|
17
|
+
// `setup` is the usual route on first render, but signing out before the
|
|
18
|
+
// `Authenticator` is rendered moves the machine past setup on its own. Send
|
|
19
|
+
// `INIT` on any route other than `idle`, which resolves the current user
|
|
20
|
+
// before the machine can accept it.
|
|
21
|
+
if (!hasInitialized.current && route !== 'idle') {
|
|
18
22
|
initializeMachine(data);
|
|
19
23
|
|
|
20
24
|
hasInitialized.current = true;
|