@liveblocks/react 2.8.0-beta1 → 2.8.0-beta3
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/{chunk-WVLHQ6LC.mjs → chunk-76MOGPE3.mjs} +99 -133
- package/dist/chunk-76MOGPE3.mjs.map +1 -0
- package/dist/{chunk-BYZWUB6M.js → chunk-D54QUPHF.js} +99 -133
- package/dist/chunk-D54QUPHF.js.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{suspense-j9RIyQIe.d.mts → suspense-FX3HjuPs.d.mts} +15 -6
- package/dist/{suspense-j9RIyQIe.d.ts → suspense-FX3HjuPs.d.ts} +15 -6
- package/dist/suspense.d.mts +1 -1
- package/dist/suspense.d.ts +1 -1
- package/dist/suspense.js +3 -3
- package/dist/suspense.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-BYZWUB6M.js.map +0 -1
- package/dist/chunk-WVLHQ6LC.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
2
|
var PKG_NAME = "@liveblocks/react";
|
|
3
|
-
var PKG_VERSION = "2.8.0-
|
|
3
|
+
var PKG_VERSION = "2.8.0-beta3";
|
|
4
4
|
var PKG_FORMAT = "esm";
|
|
5
5
|
|
|
6
6
|
// src/ClientSideSuspense.tsx
|
|
@@ -27,6 +27,7 @@ function useIsInsideRoom() {
|
|
|
27
27
|
// src/liveblocks.tsx
|
|
28
28
|
import {
|
|
29
29
|
assert,
|
|
30
|
+
autoRetry,
|
|
30
31
|
createClient,
|
|
31
32
|
kInternal,
|
|
32
33
|
makePoller,
|
|
@@ -90,7 +91,6 @@ function matchesOperator(value, op) {
|
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
// src/lib/retry-error.ts
|
|
93
|
-
import { wait } from "@liveblocks/core";
|
|
94
94
|
var MAX_ERROR_RETRY_COUNT = 5;
|
|
95
95
|
var ERROR_RETRY_INTERVAL = 5e3;
|
|
96
96
|
function retryError(action, retryCount) {
|
|
@@ -100,23 +100,6 @@ function retryError(action, retryCount) {
|
|
|
100
100
|
void action();
|
|
101
101
|
}, timeout);
|
|
102
102
|
}
|
|
103
|
-
async function autoRetry(promiseFn, maxTries, backoff) {
|
|
104
|
-
const fallbackBackoff = backoff.length > 0 ? backoff[backoff.length - 1] : 0;
|
|
105
|
-
let attempt = 0;
|
|
106
|
-
while (true) {
|
|
107
|
-
attempt++;
|
|
108
|
-
const promise = promiseFn();
|
|
109
|
-
try {
|
|
110
|
-
return await promise;
|
|
111
|
-
} catch (err) {
|
|
112
|
-
if (attempt >= maxTries) {
|
|
113
|
-
throw new Error(`Failed after ${maxTries} attempts: ${String(err)}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const delay = backoff[attempt - 1] ?? fallbackBackoff;
|
|
117
|
-
await wait(delay);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
103
|
|
|
121
104
|
// src/lib/shallow2.ts
|
|
122
105
|
import { isPlainObject as isPlainObject2, shallow } from "@liveblocks/core";
|
|
@@ -196,8 +179,15 @@ import {
|
|
|
196
179
|
console as console2,
|
|
197
180
|
createStore,
|
|
198
181
|
mapValues,
|
|
199
|
-
nanoid
|
|
182
|
+
nanoid,
|
|
183
|
+
nn
|
|
200
184
|
} from "@liveblocks/core";
|
|
185
|
+
var QUERY_STATE_LOADING = Object.freeze({ isLoading: true });
|
|
186
|
+
var QUERY_STATE_OK = Object.freeze({ isLoading: false, data: void 0 });
|
|
187
|
+
var INBOX_NOTIFICATIONS_QUERY = "INBOX_NOTIFICATIONS";
|
|
188
|
+
function makeNotificationSettingsQueryKey(roomId) {
|
|
189
|
+
return `${roomId}:NOTIFICATION_SETTINGS`;
|
|
190
|
+
}
|
|
201
191
|
var UmbrellaStore = class {
|
|
202
192
|
constructor() {
|
|
203
193
|
this._prevState = null;
|
|
@@ -212,7 +202,7 @@ var UmbrellaStore = class {
|
|
|
212
202
|
});
|
|
213
203
|
this.getThreads = this.getThreads.bind(this);
|
|
214
204
|
this.getInboxNotifications = this.getInboxNotifications.bind(this);
|
|
215
|
-
this.
|
|
205
|
+
this.getInboxNotificationsAsync = this.getInboxNotificationsAsync.bind(this);
|
|
216
206
|
this.getVersions = this.getVersions.bind(this);
|
|
217
207
|
this.subscribeThreads = this.subscribeThreads.bind(this);
|
|
218
208
|
this.subscribeInboxNotifications = this.subscribeInboxNotifications.bind(this);
|
|
@@ -225,7 +215,7 @@ var UmbrellaStore = class {
|
|
|
225
215
|
const rawState = this._store.get();
|
|
226
216
|
if (this._prevState !== rawState || this._stateCached === null) {
|
|
227
217
|
this._prevState = rawState;
|
|
228
|
-
this._stateCached =
|
|
218
|
+
this._stateCached = internalToExternalState(rawState);
|
|
229
219
|
}
|
|
230
220
|
return this._stateCached;
|
|
231
221
|
}
|
|
@@ -235,8 +225,33 @@ var UmbrellaStore = class {
|
|
|
235
225
|
getInboxNotifications() {
|
|
236
226
|
return this.get();
|
|
237
227
|
}
|
|
238
|
-
|
|
239
|
-
|
|
228
|
+
// NOTE: This will read the async result, but WILL NOT start loading at the moment!
|
|
229
|
+
getInboxNotificationsAsync() {
|
|
230
|
+
const internalState = this._store.get();
|
|
231
|
+
const query = internalState.queries[INBOX_NOTIFICATIONS_QUERY];
|
|
232
|
+
if (query === void 0 || query.isLoading) {
|
|
233
|
+
return QUERY_STATE_LOADING;
|
|
234
|
+
}
|
|
235
|
+
if (query.error !== void 0) {
|
|
236
|
+
return query;
|
|
237
|
+
}
|
|
238
|
+
const inboxNotifications = this.get().inboxNotifications;
|
|
239
|
+
return { isLoading: false, inboxNotifications };
|
|
240
|
+
}
|
|
241
|
+
// NOTE: This will read the async result, but WILL NOT start loading at the moment!
|
|
242
|
+
getNotificationSettingsAsync(roomId) {
|
|
243
|
+
const state = this.get();
|
|
244
|
+
const query = state.queries[makeNotificationSettingsQueryKey(roomId)];
|
|
245
|
+
if (query === void 0 || query.isLoading) {
|
|
246
|
+
return QUERY_STATE_LOADING;
|
|
247
|
+
}
|
|
248
|
+
if (query.error !== void 0) {
|
|
249
|
+
return query;
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
isLoading: false,
|
|
253
|
+
settings: nn(state.notificationSettingsByRoomId[roomId])
|
|
254
|
+
};
|
|
240
255
|
}
|
|
241
256
|
getVersions() {
|
|
242
257
|
return this.get();
|
|
@@ -574,16 +589,16 @@ var UmbrellaStore = class {
|
|
|
574
589
|
// Query State APIs
|
|
575
590
|
//
|
|
576
591
|
setQueryLoading(queryKey) {
|
|
577
|
-
this.setQueryState(queryKey,
|
|
592
|
+
this.setQueryState(queryKey, QUERY_STATE_LOADING);
|
|
578
593
|
}
|
|
579
594
|
setQueryOK(queryKey) {
|
|
580
|
-
this.setQueryState(queryKey,
|
|
595
|
+
this.setQueryState(queryKey, QUERY_STATE_OK);
|
|
581
596
|
}
|
|
582
597
|
setQueryError(queryKey, error) {
|
|
583
598
|
this.setQueryState(queryKey, { isLoading: false, error });
|
|
584
599
|
}
|
|
585
600
|
};
|
|
586
|
-
function
|
|
601
|
+
function internalToExternalState(state) {
|
|
587
602
|
const output = {
|
|
588
603
|
threads: { ...state.rawThreadsById },
|
|
589
604
|
inboxNotifications: { ...state.inboxNotificationsById },
|
|
@@ -899,6 +914,7 @@ function applyDeleteComment(thread, commentId, deletedAt) {
|
|
|
899
914
|
(comment) => comment.id === commentId ? {
|
|
900
915
|
...comment,
|
|
901
916
|
deletedAt,
|
|
917
|
+
// We optimistically remove the comment body and attachments when marking it as deleted
|
|
902
918
|
body: void 0,
|
|
903
919
|
attachments: []
|
|
904
920
|
} : comment
|
|
@@ -1012,55 +1028,30 @@ function missingRoomInfoError(roomId) {
|
|
|
1012
1028
|
`resolveRoomsInfo didn't return anything for room '${roomId}'`
|
|
1013
1029
|
);
|
|
1014
1030
|
}
|
|
1031
|
+
function identity(x) {
|
|
1032
|
+
return x;
|
|
1033
|
+
}
|
|
1015
1034
|
var _umbrellaStores = /* @__PURE__ */ new WeakMap();
|
|
1016
1035
|
var _extras = /* @__PURE__ */ new WeakMap();
|
|
1017
1036
|
var _bundles = /* @__PURE__ */ new WeakMap();
|
|
1018
1037
|
var POLLING_INTERVAL = 60 * 1e3;
|
|
1019
|
-
var INBOX_NOTIFICATIONS_QUERY = "INBOX_NOTIFICATIONS";
|
|
1020
1038
|
var USER_THREADS_QUERY = "USER_THREADS";
|
|
1021
|
-
function
|
|
1022
|
-
const query = state.queries[INBOX_NOTIFICATIONS_QUERY];
|
|
1023
|
-
if (query === void 0 || query.isLoading) {
|
|
1024
|
-
return {
|
|
1025
|
-
isLoading: true
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
if (query.error !== void 0) {
|
|
1029
|
-
return {
|
|
1030
|
-
error: query.error,
|
|
1031
|
-
isLoading: false
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
return {
|
|
1035
|
-
inboxNotifications: state.inboxNotifications,
|
|
1036
|
-
isLoading: false
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
function selectUnreadInboxNotificationsCount(state) {
|
|
1039
|
+
function selectUnreadInboxNotificationsCount(inboxNotifications) {
|
|
1040
1040
|
let count = 0;
|
|
1041
|
-
for (const notification of
|
|
1041
|
+
for (const notification of inboxNotifications) {
|
|
1042
1042
|
if (notification.readAt === null || notification.readAt < notification.notifiedAt) {
|
|
1043
1043
|
count++;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
return count;
|
|
1047
1047
|
}
|
|
1048
|
-
function selectorFor_useUnreadInboxNotificationsCount(
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
return {
|
|
1052
|
-
isLoading: true
|
|
1053
|
-
};
|
|
1054
|
-
}
|
|
1055
|
-
if (query.error !== void 0) {
|
|
1056
|
-
return {
|
|
1057
|
-
error: query.error,
|
|
1058
|
-
isLoading: false
|
|
1059
|
-
};
|
|
1048
|
+
function selectorFor_useUnreadInboxNotificationsCount(result) {
|
|
1049
|
+
if (!result.inboxNotifications) {
|
|
1050
|
+
return result;
|
|
1060
1051
|
}
|
|
1061
1052
|
return {
|
|
1062
1053
|
isLoading: false,
|
|
1063
|
-
count: selectUnreadInboxNotificationsCount(
|
|
1054
|
+
count: selectUnreadInboxNotificationsCount(result.inboxNotifications)
|
|
1064
1055
|
};
|
|
1065
1056
|
}
|
|
1066
1057
|
function selectorFor_useUser(state, userId) {
|
|
@@ -1345,9 +1336,9 @@ function useInboxNotifications_withClient(client) {
|
|
|
1345
1336
|
useEnableInboxNotificationsPolling();
|
|
1346
1337
|
return useSyncExternalStoreWithSelector(
|
|
1347
1338
|
store.subscribeInboxNotifications,
|
|
1348
|
-
store.
|
|
1349
|
-
store.
|
|
1350
|
-
|
|
1339
|
+
store.getInboxNotificationsAsync,
|
|
1340
|
+
store.getInboxNotificationsAsync,
|
|
1341
|
+
identity,
|
|
1351
1342
|
shallow3
|
|
1352
1343
|
);
|
|
1353
1344
|
}
|
|
@@ -1367,8 +1358,8 @@ function useUnreadInboxNotificationsCount_withClient(client) {
|
|
|
1367
1358
|
useEnableInboxNotificationsPolling();
|
|
1368
1359
|
return useSyncExternalStoreWithSelector(
|
|
1369
1360
|
store.subscribeInboxNotifications,
|
|
1370
|
-
store.
|
|
1371
|
-
store.
|
|
1361
|
+
store.getInboxNotificationsAsync,
|
|
1362
|
+
store.getInboxNotificationsAsync,
|
|
1372
1363
|
selectorFor_useUnreadInboxNotificationsCount,
|
|
1373
1364
|
shallow3
|
|
1374
1365
|
);
|
|
@@ -1922,7 +1913,6 @@ import {
|
|
|
1922
1913
|
kInternal as kInternal2,
|
|
1923
1914
|
makeEventSource,
|
|
1924
1915
|
makePoller as makePoller2,
|
|
1925
|
-
nn,
|
|
1926
1916
|
NotificationsApiError,
|
|
1927
1917
|
ServerMsgCode,
|
|
1928
1918
|
stringify as stringify2
|
|
@@ -1963,7 +1953,7 @@ function useScrollToCommentOnLoadEffect(shouldScrollOnLoad, state) {
|
|
|
1963
1953
|
var SMOOTH_DELAY = 1e3;
|
|
1964
1954
|
var noop2 = () => {
|
|
1965
1955
|
};
|
|
1966
|
-
var
|
|
1956
|
+
var identity2 = (x) => x;
|
|
1967
1957
|
var missing_unstable_batchedUpdates = (reactVersion, roomId) => `We noticed you\u2019re using React ${reactVersion}. Please pass unstable_batchedUpdates at the RoomProvider level until you\u2019re ready to upgrade to React 18:
|
|
1968
1958
|
|
|
1969
1959
|
import { unstable_batchedUpdates } from "react-dom"; // or "react-native"
|
|
@@ -1977,13 +1967,10 @@ var missing_unstable_batchedUpdates = (reactVersion, roomId) => `We noticed you\
|
|
|
1977
1967
|
Why? Please see https://liveblocks.io/docs/platform/troubleshooting#stale-props-zombie-child for more information`;
|
|
1978
1968
|
var superfluous_unstable_batchedUpdates = "You don\u2019t need to pass unstable_batchedUpdates to RoomProvider anymore, since you\u2019re on React 18+ already.";
|
|
1979
1969
|
function useSyncExternalStore2(s, gs, gss) {
|
|
1980
|
-
return useSyncExternalStoreWithSelector2(s, gs, gss,
|
|
1970
|
+
return useSyncExternalStoreWithSelector2(s, gs, gss, identity2);
|
|
1981
1971
|
}
|
|
1982
1972
|
var STABLE_EMPTY_LIST = Object.freeze([]);
|
|
1983
1973
|
var POLLING_INTERVAL2 = 5 * 60 * 1e3;
|
|
1984
|
-
function makeNotificationSettingsQueryKey(roomId) {
|
|
1985
|
-
return `${roomId}:NOTIFICATION_SETTINGS`;
|
|
1986
|
-
}
|
|
1987
1974
|
function alwaysEmptyList() {
|
|
1988
1975
|
return STABLE_EMPTY_LIST;
|
|
1989
1976
|
}
|
|
@@ -1993,10 +1980,6 @@ function alwaysNull() {
|
|
|
1993
1980
|
function selectorFor_useOthersConnectionIds(others) {
|
|
1994
1981
|
return others.map((user) => user.connectionId);
|
|
1995
1982
|
}
|
|
1996
|
-
function selectNotificationSettings(roomId, state) {
|
|
1997
|
-
const notificationSettings = state.notificationSettingsByRoomId;
|
|
1998
|
-
return nn(notificationSettings[roomId]);
|
|
1999
|
-
}
|
|
2000
1983
|
function makeMutationContext(room) {
|
|
2001
1984
|
const cannotUseUntil = "This mutation cannot be used until";
|
|
2002
1985
|
const needsPresence = `${cannotUseUntil} connected to the Liveblocks room`;
|
|
@@ -2185,7 +2168,8 @@ function makeExtrasForClient2(client) {
|
|
|
2185
2168
|
}
|
|
2186
2169
|
return;
|
|
2187
2170
|
}
|
|
2188
|
-
async function getInboxNotificationSettings(room,
|
|
2171
|
+
async function getInboxNotificationSettings(room, { retryCount } = { retryCount: 0 }) {
|
|
2172
|
+
const queryKey = makeNotificationSettingsQueryKey(room.id);
|
|
2189
2173
|
const existingRequest = requestsByQuery.get(queryKey);
|
|
2190
2174
|
if (existingRequest !== void 0) return existingRequest;
|
|
2191
2175
|
try {
|
|
@@ -2197,7 +2181,7 @@ function makeExtrasForClient2(client) {
|
|
|
2197
2181
|
} catch (err) {
|
|
2198
2182
|
requestsByQuery.delete(queryKey);
|
|
2199
2183
|
retryError(() => {
|
|
2200
|
-
void getInboxNotificationSettings(room,
|
|
2184
|
+
void getInboxNotificationSettings(room, {
|
|
2201
2185
|
retryCount: retryCount + 1
|
|
2202
2186
|
});
|
|
2203
2187
|
}, retryCount);
|
|
@@ -2583,7 +2567,7 @@ function useSelf(maybeSelector, isEqual) {
|
|
|
2583
2567
|
const room = useRoom();
|
|
2584
2568
|
const subscribe = room.events.self.subscribe;
|
|
2585
2569
|
const getSnapshot = room.getSelf;
|
|
2586
|
-
const selector = maybeSelector ??
|
|
2570
|
+
const selector = maybeSelector ?? identity2;
|
|
2587
2571
|
const wrappedSelector = React5.useCallback(
|
|
2588
2572
|
(me) => me !== null ? selector(me) : null,
|
|
2589
2573
|
[selector]
|
|
@@ -2617,7 +2601,7 @@ function useOthers(selector, isEqual) {
|
|
|
2617
2601
|
subscribe,
|
|
2618
2602
|
getSnapshot,
|
|
2619
2603
|
getServerSnapshot,
|
|
2620
|
-
selector ??
|
|
2604
|
+
selector ?? identity2,
|
|
2621
2605
|
isEqual
|
|
2622
2606
|
);
|
|
2623
2607
|
}
|
|
@@ -3270,37 +3254,51 @@ function useThreadSubscription(threadId) {
|
|
|
3270
3254
|
);
|
|
3271
3255
|
}
|
|
3272
3256
|
function useRoomNotificationSettings() {
|
|
3257
|
+
const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
|
|
3273
3258
|
const client = useClient();
|
|
3274
3259
|
const room = useRoom();
|
|
3275
3260
|
const { store } = getExtrasForClient2(client);
|
|
3261
|
+
const getter = React5.useCallback(
|
|
3262
|
+
() => store.getNotificationSettingsAsync(room.id),
|
|
3263
|
+
[store, room.id]
|
|
3264
|
+
);
|
|
3276
3265
|
React5.useEffect(() => {
|
|
3277
3266
|
const { getInboxNotificationSettings } = getExtrasForClient2(client);
|
|
3278
|
-
|
|
3279
|
-
void getInboxNotificationSettings(room, queryKey);
|
|
3267
|
+
void getInboxNotificationSettings(room);
|
|
3280
3268
|
}, [client, room]);
|
|
3269
|
+
const settings = useSyncExternalStoreWithSelector2(
|
|
3270
|
+
store.subscribeNotificationSettings,
|
|
3271
|
+
getter,
|
|
3272
|
+
getter,
|
|
3273
|
+
identity2,
|
|
3274
|
+
shallow4
|
|
3275
|
+
);
|
|
3276
|
+
return React5.useMemo(() => {
|
|
3277
|
+
return [settings, updateRoomNotificationSettings];
|
|
3278
|
+
}, [settings, updateRoomNotificationSettings]);
|
|
3279
|
+
}
|
|
3280
|
+
function useRoomNotificationSettingsSuspense() {
|
|
3281
3281
|
const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
if (query.error !== void 0) {
|
|
3289
|
-
return { isLoading: false, error: query.error };
|
|
3290
|
-
}
|
|
3291
|
-
return {
|
|
3292
|
-
isLoading: false,
|
|
3293
|
-
settings: selectNotificationSettings(room.id, state)
|
|
3294
|
-
};
|
|
3295
|
-
},
|
|
3296
|
-
[room]
|
|
3282
|
+
const client = useClient();
|
|
3283
|
+
const room = useRoom();
|
|
3284
|
+
const { store } = getExtrasForClient2(client);
|
|
3285
|
+
const getter = React5.useCallback(
|
|
3286
|
+
() => store.getNotificationSettingsAsync(room.id),
|
|
3287
|
+
[store, room.id]
|
|
3297
3288
|
);
|
|
3298
3289
|
const settings = useSyncExternalStoreWithSelector2(
|
|
3299
3290
|
store.subscribeNotificationSettings,
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3291
|
+
getter,
|
|
3292
|
+
getter,
|
|
3293
|
+
identity2,
|
|
3294
|
+
shallow4
|
|
3303
3295
|
);
|
|
3296
|
+
if (settings.isLoading) {
|
|
3297
|
+
const { getInboxNotificationSettings } = getExtrasForClient2(client);
|
|
3298
|
+
throw getInboxNotificationSettings(room);
|
|
3299
|
+
} else if (settings.error) {
|
|
3300
|
+
throw settings.error;
|
|
3301
|
+
}
|
|
3304
3302
|
return React5.useMemo(() => {
|
|
3305
3303
|
return [settings, updateRoomNotificationSettings];
|
|
3306
3304
|
}, [settings, updateRoomNotificationSettings]);
|
|
@@ -3586,38 +3584,6 @@ function useHistoryVersionsSuspense() {
|
|
|
3586
3584
|
);
|
|
3587
3585
|
return state;
|
|
3588
3586
|
}
|
|
3589
|
-
function useRoomNotificationSettingsSuspense() {
|
|
3590
|
-
const updateRoomNotificationSettings = useUpdateRoomNotificationSettings();
|
|
3591
|
-
const client = useClient();
|
|
3592
|
-
const room = useRoom();
|
|
3593
|
-
const queryKey = makeNotificationSettingsQueryKey(room.id);
|
|
3594
|
-
const { store, getInboxNotificationSettings } = getExtrasForClient2(client);
|
|
3595
|
-
const query = store.getNotificationSettings().queries[queryKey];
|
|
3596
|
-
if (query === void 0 || query.isLoading) {
|
|
3597
|
-
throw getInboxNotificationSettings(room, queryKey);
|
|
3598
|
-
}
|
|
3599
|
-
if (query.error) {
|
|
3600
|
-
throw query.error;
|
|
3601
|
-
}
|
|
3602
|
-
const selector = React5.useCallback(
|
|
3603
|
-
(state) => {
|
|
3604
|
-
return {
|
|
3605
|
-
isLoading: false,
|
|
3606
|
-
settings: selectNotificationSettings(room.id, state)
|
|
3607
|
-
};
|
|
3608
|
-
},
|
|
3609
|
-
[room]
|
|
3610
|
-
);
|
|
3611
|
-
const settings = useSyncExternalStoreWithSelector2(
|
|
3612
|
-
store.subscribeNotificationSettings,
|
|
3613
|
-
store.getNotificationSettings,
|
|
3614
|
-
store.getNotificationSettings,
|
|
3615
|
-
selector
|
|
3616
|
-
);
|
|
3617
|
-
return React5.useMemo(() => {
|
|
3618
|
-
return [settings, updateRoomNotificationSettings];
|
|
3619
|
-
}, [settings, updateRoomNotificationSettings]);
|
|
3620
|
-
}
|
|
3621
3587
|
function createRoomContext(client) {
|
|
3622
3588
|
return getOrCreateRoomContextBundle(client);
|
|
3623
3589
|
}
|
|
@@ -3749,4 +3715,4 @@ export {
|
|
|
3749
3715
|
_useStorageRoot,
|
|
3750
3716
|
_useUpdateMyPresence
|
|
3751
3717
|
};
|
|
3752
|
-
//# sourceMappingURL=chunk-
|
|
3718
|
+
//# sourceMappingURL=chunk-76MOGPE3.mjs.map
|