@rpcbase/client 0.369.0 → 0.370.0

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
@@ -5,7 +5,7 @@ import { getNavigationGuards, createRoutesFromElements, createBrowserRouter, Rou
5
5
  import { hydrateRoot } from "react-dom/client";
6
6
  import { r as reportClientException } from "./errorReporting-CVoUUKxW.js";
7
7
  import { s } from "./errorReporting-CVoUUKxW.js";
8
- import { m as useQuery } from "./useQuery-C2L-Rgat.js";
8
+ import { m as useQuery } from "./useQuery-DnrhB9w2.js";
9
9
  const emptyUnsubscribe = () => {
10
10
  };
11
11
  const useMediaQuery = (query) => {
@@ -2230,9 +2230,9 @@ function NotificationsRealtimeProvider({
2230
2230
  const trimmedUserId = typeof userId === "string" ? userId.trim() : "";
2231
2231
  const canUseRts = Boolean(trimmedUserId);
2232
2232
  const settingsQuery = useQuery(
2233
- canUseRts ? "RBNotificationSettings" : "",
2233
+ "RBNotificationSettings",
2234
2234
  useMemo(() => canUseRts ? { userId: trimmedUserId } : {}, [canUseRts, trimmedUserId]),
2235
- useMemo(() => ({ key: "rb.notifications.settings", limit: 1 }), [])
2235
+ useMemo(() => ({ key: "rb.notifications.settings", limit: 1, enabled: canUseRts }), [canUseRts])
2236
2236
  );
2237
2237
  const settings = settingsQuery.data?.[0] ?? null;
2238
2238
  const disabledTopics = useMemo(() => buildDisabledTopics(settings), [settings]);
@@ -2248,13 +2248,14 @@ function NotificationsRealtimeProvider({
2248
2248
  return base;
2249
2249
  }, [canUseRts, disabledTopics, trimmedUserId]);
2250
2250
  const notificationsQuery = useQuery(
2251
- canUseRts ? "RBNotification" : "",
2251
+ "RBNotification",
2252
2252
  query,
2253
2253
  useMemo(() => ({
2254
2254
  key: "rb.notifications",
2255
2255
  sort: { createdAt: -1 },
2256
- limit
2257
- }), [limit])
2256
+ limit,
2257
+ enabled: canUseRts
2258
+ }), [canUseRts, limit])
2258
2259
  );
2259
2260
  const notifications = useMemo(() => {
2260
2261
  const raw = notificationsQuery.data;