@asgardeo/react 0.22.0 → 0.22.2

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.
@@ -94,6 +94,10 @@ export type AsgardeoContextProps = {
94
94
  * Flag indicating whether the SDK is working in the background.
95
95
  */
96
96
  isLoading: boolean;
97
+ /**
98
+ * Flag indicating whether flow metadata is currently being fetched.
99
+ */
100
+ isMetaLoading: boolean;
97
101
  /**
98
102
  * Flag indicating whether the user is signed in or not.
99
103
  */
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ var AsgardeoContext = createContext({
37
37
  instanceId: 0,
38
38
  isInitialized: false,
39
39
  isLoading: true,
40
+ isMetaLoading: false,
40
41
  isSignedIn: false,
41
42
  meta: null,
42
43
  organization: null,
@@ -1154,8 +1155,10 @@ var useAsgardeo = () => {
1154
1155
  const flowMetaContext = useContext(FlowMetaContext_default);
1155
1156
  const i18nContext = useContext(I18nContext_default);
1156
1157
  const meta = flowMetaContext?.meta ?? null;
1158
+ const isMetaLoading = flowMetaContext?.isLoading ?? false;
1157
1159
  return {
1158
1160
  ...context,
1161
+ isMetaLoading,
1159
1162
  meta,
1160
1163
  resolveFlowTemplateLiterals: (text) => resolveFlowTemplateLiterals(text, {
1161
1164
  meta,
@@ -1187,13 +1190,14 @@ var FlowMetaProvider = ({
1187
1190
  const { baseUrl, applicationId, platform } = useAsgardeo_default();
1188
1191
  const i18nContext = useI18n_default();
1189
1192
  const [meta, setMeta] = useState3(null);
1190
- const [isLoading, setIsLoading] = useState3(false);
1193
+ const [isLoading, setIsLoading] = useState3(true);
1191
1194
  const [error, setError] = useState3(null);
1192
1195
  const [pendingLanguage, setPendingLanguage] = useState3(null);
1193
1196
  const hasFetchedRef = useRef(false);
1194
1197
  const fetchFlowMeta = useCallback3(async () => {
1195
1198
  if (!enabled || platform !== Platform2.AsgardeoV2) {
1196
1199
  setMeta(null);
1200
+ setIsLoading(false);
1197
1201
  return;
1198
1202
  }
1199
1203
  setIsLoading(true);