@3sc/common-component 0.0.370 → 0.0.371

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.es.js CHANGED
@@ -45552,8 +45552,12 @@ const UW = {
45552
45552
  }, Aw = ({ baseUrl: e }) => {
45553
45553
  const t = wt(Iw), [n, r] = Me(!1), [o, i] = Me(!1), [a, l] = Me(!1), [c, u] = Me({}), [d, f] = Me(null), [p, h] = Me(1), [g, m] = Me(!1), [v, x] = Me(0), w = gt(!1), { loading: T, data: O, isMarkAllAsRead: b } = wt(th), [k, E] = Me([]);
45554
45554
  yt(() => {
45555
- E(O);
45556
- }, [O]);
45555
+ if (g) {
45556
+ const F = (O || []).filter((_) => !_.isRead);
45557
+ E(F);
45558
+ } else
45559
+ E(O);
45560
+ }, [O, g]);
45557
45561
  const P = Kt(async () => {
45558
45562
  var F, _, $;
45559
45563
  if (!w.current)
@@ -45608,14 +45612,14 @@ const UW = {
45608
45612
  try {
45609
45613
  if ((await Ty(e, F, _)).status === Uo.OK) {
45610
45614
  const L = O.map(
45611
- (N) => F.includes(N.id) ? { ...N, isRead: !0 } : N
45612
- ), R = L.filter((N) => !N.isRead).length;
45615
+ (W) => F.includes(W.id) ? { ...W, isRead: !0 } : W
45616
+ ), N = L.filter((W) => !W.isRead).length;
45613
45617
  t({
45614
45618
  type: qe.SUCCESS,
45615
45619
  data: Xa(L)
45616
45620
  }), t({
45617
45621
  type: qe.MARK_ALL_AS_READ,
45618
- isMarkAllAsRead: { count: R, boo: R > 0 }
45622
+ isMarkAllAsRead: { count: N, boo: N > 0 }
45619
45623
  }), setTimeout(() => {
45620
45624
  t({ type: qe.LOADING, loading: !1 });
45621
45625
  }, 200);