@appcorp/fusion-storybook 0.3.42 → 0.3.43

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.
@@ -398,16 +398,16 @@ export const useFeeStructureModule = () => {
398
398
  // ============================================================================
399
399
  // 1.4.9 EFFECTS
400
400
  // ============================================================================
401
+ // Sync ref to always point at latest listFetchNow (avoids stale closure in callbacks)
402
+ useEffect(() => {
403
+ listFetchNowRef.current = listFetchNow;
404
+ }, [listFetchNow]);
401
405
  useEffect(() => {
402
406
  var _a;
403
407
  if (!schoolId)
404
408
  return;
405
409
  (_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
406
410
  }, [dispatch, listParams, showToast, t, schoolId]);
407
- // Sync ref to always point at latest listFetchNow (avoids stale closure in callbacks)
408
- useEffect(() => {
409
- listFetchNowRef.current = listFetchNow;
410
- }, [listFetchNow]);
411
411
  // ============================================================================
412
412
  // 1.4.10 RETURN
413
413
  // ============================================================================
@@ -28,14 +28,13 @@ export const useStudentFeeModule = () => {
28
28
  // ============================================================================
29
29
  // 1.4.1 STATE & CORE HOOKS
30
30
  // ============================================================================
31
- var _a, _b, _c, _d, _e, _f, _g;
31
+ var _a, _b, _c, _d, _e, _f;
32
32
  const context = useStudentFeeContext();
33
33
  const { dispatch } = context;
34
34
  const state = context.state;
35
35
  const t = useTranslations("studentFee");
36
36
  const { theme } = useTheme();
37
37
  const workspace = getCachedWorkspaceSync();
38
- console.log("[DIAG] useStudentFeeModule workspace?.school?.id:", (_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id, "workspace keys:", workspace ? Object.keys(workspace) : null);
39
38
  const listFetchNowRef = useRef(null);
40
39
  const debouncedQuery = useDebounce(state.searchQuery, 800);
41
40
  // ============================================================================
@@ -52,7 +51,7 @@ export const useStudentFeeModule = () => {
52
51
  state.filterStatus,
53
52
  state.pageLimit,
54
53
  debouncedQuery,
55
- (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id,
54
+ (_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id,
56
55
  ]);
57
56
  const updateParams = useMemo(() => {
58
57
  var _a;
@@ -72,7 +71,7 @@ export const useStudentFeeModule = () => {
72
71
  status: state.status,
73
72
  studentProfileId: state.studentProfileId,
74
73
  });
75
- }, [state, (_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.id]);
74
+ }, [state, (_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id]);
76
75
  const byIdParams = useMemo(() => ({ id: state.id }), [state.id]);
77
76
  const deleteParams = useMemo(() => ({ id: state.id }), [state.id]);
78
77
  // ============================================================================
@@ -141,7 +140,7 @@ export const useStudentFeeModule = () => {
141
140
  },
142
141
  },
143
142
  });
144
- }, [dispatch, workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength, (_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.id]);
143
+ }, [dispatch, workspace === null || workspace === void 0 ? void 0 : workspace.dueDateLength, (_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.id]);
145
144
  // ============================================================================
146
145
  // 1.4.4 API CALLBACKS
147
146
  // ============================================================================
@@ -540,7 +539,7 @@ export const useStudentFeeModule = () => {
540
539
  payload: { disabled: false },
541
540
  });
542
541
  }
543
- }, [dispatch, showToast, t, (_e = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _e === void 0 ? void 0 : _e.id, resetFormAndCloseDrawer]);
542
+ }, [dispatch, showToast, t, (_d = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _d === void 0 ? void 0 : _d.id, resetFormAndCloseDrawer]);
544
543
  const handleSubmit = useCallback(() => {
545
544
  dispatch({
546
545
  type: STUDENT_FEE_ACTION_TYPES.SET_DISABLE_SAVE_BUTTON,
@@ -604,7 +603,7 @@ export const useStudentFeeModule = () => {
604
603
  payload: { disabled: false },
605
604
  });
606
605
  }
607
- }, [dispatch, showToast, t, (_f = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _f === void 0 ? void 0 : _f.id, resetFormAndCloseDrawer]);
606
+ }, [dispatch, showToast, t, (_e = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _e === void 0 ? void 0 : _e.id, resetFormAndCloseDrawer]);
608
607
  // ============================================================================
609
608
  // 1.4.8 HEADER & ROW ACTIONS
610
609
  // ============================================================================
@@ -672,17 +671,14 @@ export const useStudentFeeModule = () => {
672
671
  // 1.4.9 EFFECTS
673
672
  // ============================================================================
674
673
  useEffect(() => {
675
- console.log("[DIAG] listFetchNow available:", !!listFetchNow);
676
674
  listFetchNowRef.current = listFetchNow;
677
675
  }, [listFetchNow]);
678
676
  useEffect(() => {
679
- var _a, _b, _c;
680
- console.log("[DIAG] initial fetch effect running, guard:", !!((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id), "has listFetchNowRef:", !!listFetchNowRef.current, "listParams:", JSON.stringify(listParams));
681
- if (!((_b = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _b === void 0 ? void 0 : _b.id))
677
+ var _a, _b;
678
+ if (!((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id))
682
679
  return;
683
- console.log("[DIAG] about to call listFetchNowRef.current()");
684
- (_c = listFetchNowRef.current) === null || _c === void 0 ? void 0 : _c.call(listFetchNowRef);
685
- }, [dispatch, listParams, (_g = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _g === void 0 ? void 0 : _g.id, showToast, t]);
680
+ (_b = listFetchNowRef.current) === null || _b === void 0 ? void 0 : _b.call(listFetchNowRef);
681
+ }, [dispatch, listParams, (_f = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _f === void 0 ? void 0 : _f.id, showToast, t]);
686
682
  // ============================================================================
687
683
  // 1.4.10 RETURN
688
684
  // ============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.3.42",
3
+ "version": "0.3.43",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",