@asgardeo/react 0.22.2 → 0.22.3

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 CHANGED
@@ -1193,13 +1193,16 @@ var FlowMetaProvider = ({
1193
1193
  const [isLoading, setIsLoading] = useState3(true);
1194
1194
  const [error, setError] = useState3(null);
1195
1195
  const [pendingLanguage, setPendingLanguage] = useState3(null);
1196
- const hasFetchedRef = useRef(false);
1196
+ const lastFetchedRef = useRef(null);
1197
1197
  const fetchFlowMeta = useCallback3(async () => {
1198
1198
  if (!enabled || platform !== Platform2.AsgardeoV2) {
1199
1199
  setMeta(null);
1200
1200
  setIsLoading(false);
1201
1201
  return;
1202
1202
  }
1203
+ if (!applicationId) {
1204
+ return;
1205
+ }
1203
1206
  setIsLoading(true);
1204
1207
  setError(null);
1205
1208
  try {
@@ -1253,11 +1256,10 @@ var FlowMetaProvider = ({
1253
1256
  }
1254
1257
  }, [pendingLanguage, i18nContext?.setLanguage]);
1255
1258
  useEffect2(() => {
1256
- if (!hasFetchedRef.current) {
1257
- hasFetchedRef.current = true;
1258
- fetchFlowMeta();
1259
+ if (lastFetchedRef.current === fetchFlowMeta) {
1259
1260
  return;
1260
1261
  }
1262
+ lastFetchedRef.current = fetchFlowMeta;
1261
1263
  fetchFlowMeta();
1262
1264
  }, [fetchFlowMeta]);
1263
1265
  useEffect2(() => {