@rpcbase/client 0.459.0 → 0.460.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 +207 -154
- package/dist/index.js.map +1 -1
- package/dist/notifications.d.ts +1 -0
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notificationsRealtime.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -416,7 +416,7 @@ function _temp4$1() {
|
|
|
416
416
|
function _temp5$1() {
|
|
417
417
|
return startToaster();
|
|
418
418
|
}
|
|
419
|
-
function _temp6() {
|
|
419
|
+
function _temp6$1() {
|
|
420
420
|
return startToaster();
|
|
421
421
|
}
|
|
422
422
|
function _temp7() {
|
|
@@ -426,7 +426,7 @@ function _temp7() {
|
|
|
426
426
|
});
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
window.setTimeout(_temp6, 150);
|
|
429
|
+
window.setTimeout(_temp6$1, 150);
|
|
430
430
|
}
|
|
431
431
|
function _temp8() {
|
|
432
432
|
if (typeof window === "undefined") {
|
|
@@ -2566,13 +2566,15 @@ const toIso = (value) => {
|
|
|
2566
2566
|
return void 0;
|
|
2567
2567
|
};
|
|
2568
2568
|
const toNotificationItem = (doc) => {
|
|
2569
|
-
const
|
|
2569
|
+
const rawId = doc.notificationId ?? doc._id;
|
|
2570
|
+
const id = typeof rawId === "string" ? rawId : String(rawId ?? "");
|
|
2570
2571
|
if (!id) return null;
|
|
2571
2572
|
if (typeof doc.title !== "string") return null;
|
|
2572
2573
|
return {
|
|
2573
2574
|
id,
|
|
2574
2575
|
topic: typeof doc.topic === "string" ? doc.topic : void 0,
|
|
2575
2576
|
tag: typeof doc.tag === "string" ? doc.tag : void 0,
|
|
2577
|
+
deliveryId: typeof doc.deliveryId === "string" ? doc.deliveryId : void 0,
|
|
2576
2578
|
title: doc.title,
|
|
2577
2579
|
body: doc.body,
|
|
2578
2580
|
image: doc.image,
|
|
@@ -2644,6 +2646,7 @@ const getScopedNotificationKey = (userId, appName) => `${encodeURIComponent(appN
|
|
|
2644
2646
|
const getTabStateKey = (userId, appName) => `${TAB_STATE_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}:${NOTIFICATION_TAB_ID}`;
|
|
2645
2647
|
const getTabStateKeyPrefix = (userId, appName) => `${TAB_STATE_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}:`;
|
|
2646
2648
|
const getDeliveryKey = (userId, appName, mode, notificationId) => `${DELIVERY_KEY_PREFIX}${mode}:${getScopedNotificationKey(userId, appName)}:${encodeURIComponent(notificationId)}`;
|
|
2649
|
+
const getNotificationDeliveryId = (item) => item.deliveryId ?? `${item.id}:${item.createdAt}`;
|
|
2647
2650
|
const getDeliveryLockName = (userId, appName) => `${DELIVERY_LOCK_PREFIX}${getScopedNotificationKey(userId, appName)}`;
|
|
2648
2651
|
const getFallbackDeliveryLockKey = (userId, appName) => `${FALLBACK_DELIVERY_LOCK_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}`;
|
|
2649
2652
|
const getLocalStorage = () => {
|
|
@@ -2734,20 +2737,20 @@ const removeNotificationDeliveryMarkers = (items, userId, appName, mode) => {
|
|
|
2734
2737
|
if (!storage) return;
|
|
2735
2738
|
try {
|
|
2736
2739
|
for (const item of items) {
|
|
2737
|
-
storage.removeItem(getDeliveryKey(userId, appName, mode, item
|
|
2740
|
+
storage.removeItem(getDeliveryKey(userId, appName, mode, getNotificationDeliveryId(item)));
|
|
2738
2741
|
}
|
|
2739
2742
|
} catch {
|
|
2740
2743
|
return;
|
|
2741
2744
|
}
|
|
2742
2745
|
};
|
|
2743
|
-
const filterNotificationsWithoutDelivery = (items, userId, appName, mode) => items.filter((item) => !hasRecentNotificationDelivery(userId, appName, mode, item
|
|
2746
|
+
const filterNotificationsWithoutDelivery = (items, userId, appName, mode) => items.filter((item) => !hasRecentNotificationDelivery(userId, appName, mode, getNotificationDeliveryId(item)));
|
|
2744
2747
|
const claimNotificationDeliveriesFromStorage = (items, userId, appName, mode) => {
|
|
2745
2748
|
const storage = getLocalStorage();
|
|
2746
2749
|
if (!storage) return items;
|
|
2747
2750
|
const now = Date.now();
|
|
2748
2751
|
const claimed = [];
|
|
2749
2752
|
for (const item of items) {
|
|
2750
|
-
const key = getDeliveryKey(userId, appName, mode, item
|
|
2753
|
+
const key = getDeliveryKey(userId, appName, mode, getNotificationDeliveryId(item));
|
|
2751
2754
|
const current = parseJsonRecord(storage.getItem(key));
|
|
2752
2755
|
const deliveredAt = typeof current?.deliveredAt === "number" ? current.deliveredAt : 0;
|
|
2753
2756
|
if (deliveredAt && now - deliveredAt < DELIVERY_TTL_MS) continue;
|
|
@@ -2838,7 +2841,7 @@ const claimNotificationDeliveries = async (items, userId, appName, mode) => {
|
|
|
2838
2841
|
};
|
|
2839
2842
|
const showCustomInAppNotification = (item, renderer) => {
|
|
2840
2843
|
const action = getNotificationAction(item);
|
|
2841
|
-
let toastId
|
|
2844
|
+
let toastId;
|
|
2842
2845
|
const controls = {
|
|
2843
2846
|
dismiss: () => {
|
|
2844
2847
|
if (toastId !== void 0) toast.dismiss(toastId);
|
|
@@ -2852,7 +2855,6 @@ const showCustomInAppNotification = (item, renderer) => {
|
|
|
2852
2855
|
const content = renderer(item, controls);
|
|
2853
2856
|
if (content === null || content === void 0) return false;
|
|
2854
2857
|
toastId = toast.custom(() => /* @__PURE__ */ jsx(Fragment, { children: content }), {
|
|
2855
|
-
id: toastId,
|
|
2856
2858
|
position: "top-right"
|
|
2857
2859
|
});
|
|
2858
2860
|
return true;
|
|
@@ -2873,7 +2875,6 @@ const showInAppNotifications = (items, renderNotificationToast) => {
|
|
|
2873
2875
|
if (renderNotificationToast && showCustomInAppNotification(item, renderNotificationToast)) continue;
|
|
2874
2876
|
toast(item.title, {
|
|
2875
2877
|
...notificationToastOptions,
|
|
2876
|
-
id: item.tag ? `${NATIVE_NOTIFICATION_TAG_PREFIX}:${encodeURIComponent(item.tag)}` : void 0,
|
|
2877
2878
|
description: item.body
|
|
2878
2879
|
});
|
|
2879
2880
|
}
|
|
@@ -2894,7 +2895,7 @@ const getNativeNotificationOptions = (item) => {
|
|
|
2894
2895
|
return {
|
|
2895
2896
|
body: item.body,
|
|
2896
2897
|
icon: item.image,
|
|
2897
|
-
tag: `${NATIVE_NOTIFICATION_TAG_PREFIX}:${encodeURIComponent(item
|
|
2898
|
+
tag: `${NATIVE_NOTIFICATION_TAG_PREFIX}:${encodeURIComponent(getNotificationDeliveryId(item))}`,
|
|
2898
2899
|
data: {
|
|
2899
2900
|
...item.data,
|
|
2900
2901
|
notificationId: item.id,
|
|
@@ -2972,12 +2973,12 @@ const flushPendingInAppToasts = (pendingInAppToastItems, userId, appName, render
|
|
|
2972
2973
|
};
|
|
2973
2974
|
const queuePendingInAppToasts = (pendingInAppToastItems, items, userId, appName, renderNotificationToast) => {
|
|
2974
2975
|
for (const item of items) {
|
|
2975
|
-
pendingInAppToastItems.current.set(item
|
|
2976
|
+
pendingInAppToastItems.current.set(getNotificationDeliveryId(item), item);
|
|
2976
2977
|
}
|
|
2977
2978
|
flushPendingInAppToasts(pendingInAppToastItems, userId, appName, renderNotificationToast);
|
|
2978
2979
|
};
|
|
2979
2980
|
function NotificationsRealtimeProvider(t0) {
|
|
2980
|
-
const $ = c(
|
|
2981
|
+
const $ = c(73);
|
|
2981
2982
|
const {
|
|
2982
2983
|
userId,
|
|
2983
2984
|
appName,
|
|
@@ -3116,99 +3117,148 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3116
3117
|
}
|
|
3117
3118
|
const notificationsQuery = useQuery("RBNotification", query, t10);
|
|
3118
3119
|
let t11;
|
|
3120
|
+
if ($[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3121
|
+
t11 = {
|
|
3122
|
+
createdAt: -1
|
|
3123
|
+
};
|
|
3124
|
+
$[22] = t11;
|
|
3125
|
+
} else {
|
|
3126
|
+
t11 = $[22];
|
|
3127
|
+
}
|
|
3128
|
+
let t12;
|
|
3129
|
+
if ($[23] !== canUseRts || $[24] !== limit) {
|
|
3130
|
+
t12 = {
|
|
3131
|
+
key: "rb.notification-deliveries",
|
|
3132
|
+
sort: t11,
|
|
3133
|
+
limit,
|
|
3134
|
+
enabled: canUseRts
|
|
3135
|
+
};
|
|
3136
|
+
$[23] = canUseRts;
|
|
3137
|
+
$[24] = limit;
|
|
3138
|
+
$[25] = t12;
|
|
3139
|
+
} else {
|
|
3140
|
+
t12 = $[25];
|
|
3141
|
+
}
|
|
3142
|
+
const notificationDeliveriesQuery = useQuery("RBNotificationDelivery", query, t12);
|
|
3143
|
+
let t13;
|
|
3119
3144
|
bb1: {
|
|
3120
3145
|
const raw = notificationsQuery.data;
|
|
3121
3146
|
if (!Array.isArray(raw)) {
|
|
3122
|
-
let
|
|
3123
|
-
if ($[
|
|
3124
|
-
|
|
3125
|
-
$[
|
|
3147
|
+
let t143;
|
|
3148
|
+
if ($[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3149
|
+
t143 = [];
|
|
3150
|
+
$[26] = t143;
|
|
3126
3151
|
} else {
|
|
3127
|
-
|
|
3152
|
+
t143 = $[26];
|
|
3128
3153
|
}
|
|
3129
|
-
|
|
3154
|
+
t13 = t143;
|
|
3130
3155
|
break bb1;
|
|
3131
3156
|
}
|
|
3132
|
-
let
|
|
3133
|
-
if ($[
|
|
3134
|
-
|
|
3135
|
-
$[
|
|
3136
|
-
$[
|
|
3157
|
+
let t142;
|
|
3158
|
+
if ($[27] !== raw) {
|
|
3159
|
+
t142 = raw.map(_temp).filter(_temp2);
|
|
3160
|
+
$[27] = raw;
|
|
3161
|
+
$[28] = t142;
|
|
3137
3162
|
} else {
|
|
3138
|
-
|
|
3163
|
+
t142 = $[28];
|
|
3139
3164
|
}
|
|
3140
|
-
|
|
3165
|
+
t13 = t142;
|
|
3141
3166
|
}
|
|
3142
|
-
const notifications =
|
|
3143
|
-
let
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3167
|
+
const notifications = t13;
|
|
3168
|
+
let t14;
|
|
3169
|
+
bb2: {
|
|
3170
|
+
const raw_0 = notificationDeliveriesQuery.data;
|
|
3171
|
+
if (!Array.isArray(raw_0)) {
|
|
3172
|
+
let t153;
|
|
3173
|
+
if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3174
|
+
t153 = [];
|
|
3175
|
+
$[29] = t153;
|
|
3176
|
+
} else {
|
|
3177
|
+
t153 = $[29];
|
|
3178
|
+
}
|
|
3179
|
+
t14 = t153;
|
|
3180
|
+
break bb2;
|
|
3181
|
+
}
|
|
3182
|
+
let t152;
|
|
3183
|
+
if ($[30] !== raw_0) {
|
|
3184
|
+
t152 = raw_0.map(_temp3).filter(_temp4);
|
|
3185
|
+
$[30] = raw_0;
|
|
3186
|
+
$[31] = t152;
|
|
3187
|
+
} else {
|
|
3188
|
+
t152 = $[31];
|
|
3189
|
+
}
|
|
3190
|
+
t14 = t152;
|
|
3191
|
+
}
|
|
3192
|
+
const notificationDeliveries = t14;
|
|
3193
|
+
let t15;
|
|
3194
|
+
if ($[32] !== notifications) {
|
|
3195
|
+
t15 = notifications.reduce(_temp5, 0);
|
|
3196
|
+
$[32] = notifications;
|
|
3197
|
+
$[33] = t15;
|
|
3148
3198
|
} else {
|
|
3149
|
-
|
|
3199
|
+
t15 = $[33];
|
|
3150
3200
|
}
|
|
3151
|
-
const unreadCount =
|
|
3152
|
-
let
|
|
3153
|
-
if ($[
|
|
3154
|
-
|
|
3155
|
-
$[
|
|
3156
|
-
$[
|
|
3201
|
+
const unreadCount = t15;
|
|
3202
|
+
let t16;
|
|
3203
|
+
if ($[34] !== notifications) {
|
|
3204
|
+
t16 = notifications.reduce(_temp6, 0);
|
|
3205
|
+
$[34] = notifications;
|
|
3206
|
+
$[35] = t16;
|
|
3157
3207
|
} else {
|
|
3158
|
-
|
|
3208
|
+
t16 = $[35];
|
|
3159
3209
|
}
|
|
3160
|
-
const unseenCount =
|
|
3161
|
-
let
|
|
3162
|
-
if ($[
|
|
3163
|
-
|
|
3164
|
-
$[
|
|
3210
|
+
const unseenCount = t16;
|
|
3211
|
+
let t17;
|
|
3212
|
+
if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3213
|
+
t17 = /* @__PURE__ */ new Set();
|
|
3214
|
+
$[36] = t17;
|
|
3165
3215
|
} else {
|
|
3166
|
-
|
|
3216
|
+
t17 = $[36];
|
|
3167
3217
|
}
|
|
3168
|
-
const
|
|
3218
|
+
const lastToastDeliveryIds = useRef(t17);
|
|
3169
3219
|
const hasSeededToastIds = useRef(false);
|
|
3170
|
-
let
|
|
3171
|
-
if ($[
|
|
3172
|
-
|
|
3173
|
-
$[
|
|
3220
|
+
let t18;
|
|
3221
|
+
if ($[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3222
|
+
t18 = Date.now();
|
|
3223
|
+
$[37] = t18;
|
|
3174
3224
|
} else {
|
|
3175
|
-
|
|
3225
|
+
t18 = $[37];
|
|
3176
3226
|
}
|
|
3177
|
-
const toastStartMs = useRef(
|
|
3178
|
-
let
|
|
3179
|
-
if ($[
|
|
3180
|
-
|
|
3181
|
-
$[
|
|
3227
|
+
const toastStartMs = useRef(t18);
|
|
3228
|
+
let t19;
|
|
3229
|
+
if ($[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3230
|
+
t19 = /* @__PURE__ */ new Map();
|
|
3231
|
+
$[38] = t19;
|
|
3182
3232
|
} else {
|
|
3183
|
-
|
|
3233
|
+
t19 = $[38];
|
|
3184
3234
|
}
|
|
3185
|
-
const pendingInAppToastItems = useRef(
|
|
3186
|
-
let
|
|
3187
|
-
if ($[
|
|
3188
|
-
|
|
3235
|
+
const pendingInAppToastItems = useRef(t19);
|
|
3236
|
+
let t20;
|
|
3237
|
+
if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3238
|
+
t20 = () => {
|
|
3189
3239
|
hasSeededToastIds.current = false;
|
|
3190
|
-
|
|
3240
|
+
lastToastDeliveryIds.current = /* @__PURE__ */ new Set();
|
|
3191
3241
|
toastStartMs.current = Date.now();
|
|
3192
3242
|
pendingInAppToastItems.current = /* @__PURE__ */ new Map();
|
|
3193
3243
|
};
|
|
3194
|
-
$[
|
|
3244
|
+
$[39] = t20;
|
|
3195
3245
|
} else {
|
|
3196
|
-
|
|
3246
|
+
t20 = $[39];
|
|
3197
3247
|
}
|
|
3198
|
-
let
|
|
3199
|
-
if ($[
|
|
3200
|
-
|
|
3201
|
-
$[
|
|
3202
|
-
$[
|
|
3203
|
-
$[
|
|
3248
|
+
let t21;
|
|
3249
|
+
if ($[40] !== normalizedAppName || $[41] !== trimmedUserId) {
|
|
3250
|
+
t21 = [normalizedAppName, trimmedUserId];
|
|
3251
|
+
$[40] = normalizedAppName;
|
|
3252
|
+
$[41] = trimmedUserId;
|
|
3253
|
+
$[42] = t21;
|
|
3204
3254
|
} else {
|
|
3205
|
-
|
|
3255
|
+
t21 = $[42];
|
|
3206
3256
|
}
|
|
3207
|
-
useEffect(
|
|
3208
|
-
let
|
|
3209
|
-
let
|
|
3210
|
-
if ($[
|
|
3211
|
-
|
|
3257
|
+
useEffect(t20, t21);
|
|
3258
|
+
let t22;
|
|
3259
|
+
let t23;
|
|
3260
|
+
if ($[43] !== canUseRts || $[44] !== normalizedAppName || $[45] !== trimmedUserId) {
|
|
3261
|
+
t22 = () => {
|
|
3212
3262
|
if (!canUseRts) {
|
|
3213
3263
|
return;
|
|
3214
3264
|
}
|
|
@@ -3234,21 +3284,21 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3234
3284
|
removeState();
|
|
3235
3285
|
};
|
|
3236
3286
|
};
|
|
3237
|
-
|
|
3238
|
-
$[
|
|
3239
|
-
$[
|
|
3240
|
-
$[
|
|
3241
|
-
$[
|
|
3242
|
-
$[
|
|
3287
|
+
t23 = [canUseRts, normalizedAppName, trimmedUserId];
|
|
3288
|
+
$[43] = canUseRts;
|
|
3289
|
+
$[44] = normalizedAppName;
|
|
3290
|
+
$[45] = trimmedUserId;
|
|
3291
|
+
$[46] = t22;
|
|
3292
|
+
$[47] = t23;
|
|
3243
3293
|
} else {
|
|
3244
|
-
|
|
3245
|
-
|
|
3294
|
+
t22 = $[46];
|
|
3295
|
+
t23 = $[47];
|
|
3246
3296
|
}
|
|
3247
|
-
useEffect(
|
|
3248
|
-
let
|
|
3249
|
-
let
|
|
3250
|
-
if ($[
|
|
3251
|
-
|
|
3297
|
+
useEffect(t22, t23);
|
|
3298
|
+
let t24;
|
|
3299
|
+
let t25;
|
|
3300
|
+
if ($[48] !== canUseRts || $[49] !== normalizedAppName || $[50] !== renderNotificationToast || $[51] !== trimmedUserId) {
|
|
3301
|
+
t24 = () => {
|
|
3252
3302
|
if (!canUseRts) {
|
|
3253
3303
|
return;
|
|
3254
3304
|
}
|
|
@@ -3265,35 +3315,35 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3265
3315
|
document.removeEventListener("visibilitychange", handlePendingInAppToastFlush);
|
|
3266
3316
|
};
|
|
3267
3317
|
};
|
|
3268
|
-
|
|
3269
|
-
$[
|
|
3270
|
-
$[
|
|
3271
|
-
$[
|
|
3272
|
-
$[
|
|
3273
|
-
$[
|
|
3274
|
-
$[
|
|
3318
|
+
t25 = [canUseRts, normalizedAppName, renderNotificationToast, trimmedUserId];
|
|
3319
|
+
$[48] = canUseRts;
|
|
3320
|
+
$[49] = normalizedAppName;
|
|
3321
|
+
$[50] = renderNotificationToast;
|
|
3322
|
+
$[51] = trimmedUserId;
|
|
3323
|
+
$[52] = t24;
|
|
3324
|
+
$[53] = t25;
|
|
3275
3325
|
} else {
|
|
3276
|
-
|
|
3277
|
-
|
|
3326
|
+
t24 = $[52];
|
|
3327
|
+
t25 = $[53];
|
|
3278
3328
|
}
|
|
3279
|
-
useEffect(
|
|
3280
|
-
let
|
|
3281
|
-
let
|
|
3282
|
-
if ($[
|
|
3283
|
-
|
|
3329
|
+
useEffect(t24, t25);
|
|
3330
|
+
let t26;
|
|
3331
|
+
let t27;
|
|
3332
|
+
if ($[54] !== canUseRts || $[55] !== normalizedAppName || $[56] !== notificationDeliveries || $[57] !== notificationDeliveriesQuery.loading || $[58] !== renderNotificationToast || $[59] !== toastOnNew || $[60] !== trimmedUserId) {
|
|
3333
|
+
t26 = () => {
|
|
3284
3334
|
if (!toastOnNew) {
|
|
3285
3335
|
return;
|
|
3286
3336
|
}
|
|
3287
3337
|
if (!canUseRts) {
|
|
3288
3338
|
return;
|
|
3289
3339
|
}
|
|
3290
|
-
if (
|
|
3340
|
+
if (notificationDeliveriesQuery.loading) {
|
|
3291
3341
|
return;
|
|
3292
3342
|
}
|
|
3293
3343
|
if (!hasSeededToastIds.current) {
|
|
3294
3344
|
hasSeededToastIds.current = true;
|
|
3295
|
-
|
|
3296
|
-
const eligible =
|
|
3345
|
+
lastToastDeliveryIds.current = new Set(notificationDeliveries.map(getNotificationDeliveryId));
|
|
3346
|
+
const eligible = notificationDeliveries.filter((n_3) => {
|
|
3297
3347
|
const createdAtMs = Date.parse(n_3.createdAt);
|
|
3298
3348
|
if (!Number.isFinite(createdAtMs)) {
|
|
3299
3349
|
return false;
|
|
@@ -3307,12 +3357,12 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3307
3357
|
}
|
|
3308
3358
|
return;
|
|
3309
3359
|
}
|
|
3310
|
-
const nextNew =
|
|
3360
|
+
const nextNew = notificationDeliveries.filter((n_4) => !lastToastDeliveryIds.current.has(getNotificationDeliveryId(n_4)));
|
|
3311
3361
|
if (!nextNew.length) {
|
|
3312
3362
|
return;
|
|
3313
3363
|
}
|
|
3314
3364
|
for (const n_5 of nextNew) {
|
|
3315
|
-
|
|
3365
|
+
lastToastDeliveryIds.current.add(getNotificationDeliveryId(n_5));
|
|
3316
3366
|
}
|
|
3317
3367
|
const eligible_0 = nextNew.filter((n_6) => {
|
|
3318
3368
|
const createdAtMs_0 = Date.parse(n_6.createdAt);
|
|
@@ -3328,70 +3378,73 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3328
3378
|
queuePendingInAppToasts(pendingInAppToastItems, pending_0, trimmedUserId, normalizedAppName, renderNotificationToast);
|
|
3329
3379
|
});
|
|
3330
3380
|
};
|
|
3331
|
-
|
|
3332
|
-
$[
|
|
3333
|
-
$[
|
|
3334
|
-
$[
|
|
3335
|
-
$[
|
|
3336
|
-
$[
|
|
3337
|
-
$[
|
|
3338
|
-
$[
|
|
3339
|
-
$[
|
|
3340
|
-
$[
|
|
3381
|
+
t27 = [canUseRts, normalizedAppName, notificationDeliveries, notificationDeliveriesQuery.loading, renderNotificationToast, toastOnNew, trimmedUserId];
|
|
3382
|
+
$[54] = canUseRts;
|
|
3383
|
+
$[55] = normalizedAppName;
|
|
3384
|
+
$[56] = notificationDeliveries;
|
|
3385
|
+
$[57] = notificationDeliveriesQuery.loading;
|
|
3386
|
+
$[58] = renderNotificationToast;
|
|
3387
|
+
$[59] = toastOnNew;
|
|
3388
|
+
$[60] = trimmedUserId;
|
|
3389
|
+
$[61] = t26;
|
|
3390
|
+
$[62] = t27;
|
|
3341
3391
|
} else {
|
|
3342
|
-
|
|
3343
|
-
|
|
3392
|
+
t26 = $[61];
|
|
3393
|
+
t27 = $[62];
|
|
3344
3394
|
}
|
|
3345
|
-
useEffect(
|
|
3346
|
-
let
|
|
3347
|
-
if ($[
|
|
3348
|
-
|
|
3395
|
+
useEffect(t26, t27);
|
|
3396
|
+
let t28;
|
|
3397
|
+
if ($[63] !== notifications || $[64] !== notificationsQuery.error || $[65] !== notificationsQuery.loading || $[66] !== unreadCount || $[67] !== unseenCount) {
|
|
3398
|
+
t28 = {
|
|
3349
3399
|
notifications,
|
|
3350
3400
|
unreadCount,
|
|
3351
3401
|
unseenCount,
|
|
3352
3402
|
loading: notificationsQuery.loading,
|
|
3353
3403
|
error: notificationsQuery.error
|
|
3354
3404
|
};
|
|
3355
|
-
$[
|
|
3356
|
-
$[
|
|
3357
|
-
$[
|
|
3358
|
-
$[
|
|
3359
|
-
$[
|
|
3360
|
-
$[
|
|
3405
|
+
$[63] = notifications;
|
|
3406
|
+
$[64] = notificationsQuery.error;
|
|
3407
|
+
$[65] = notificationsQuery.loading;
|
|
3408
|
+
$[66] = unreadCount;
|
|
3409
|
+
$[67] = unseenCount;
|
|
3410
|
+
$[68] = t28;
|
|
3361
3411
|
} else {
|
|
3362
|
-
|
|
3363
|
-
}
|
|
3364
|
-
const value =
|
|
3365
|
-
const
|
|
3366
|
-
let
|
|
3367
|
-
if ($[
|
|
3368
|
-
|
|
3369
|
-
$[
|
|
3412
|
+
t28 = $[68];
|
|
3413
|
+
}
|
|
3414
|
+
const value = t28;
|
|
3415
|
+
const t29 = canUseRts ? value : null;
|
|
3416
|
+
let t30;
|
|
3417
|
+
if ($[69] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3418
|
+
t30 = /* @__PURE__ */ jsx("style", { children: notificationToastStyles });
|
|
3419
|
+
$[69] = t30;
|
|
3370
3420
|
} else {
|
|
3371
|
-
|
|
3421
|
+
t30 = $[69];
|
|
3372
3422
|
}
|
|
3373
|
-
let
|
|
3374
|
-
if ($[
|
|
3375
|
-
|
|
3376
|
-
|
|
3423
|
+
let t31;
|
|
3424
|
+
if ($[70] !== children || $[71] !== t29) {
|
|
3425
|
+
t31 = /* @__PURE__ */ jsxs(NotificationsRealtimeContext.Provider, { value: t29, children: [
|
|
3426
|
+
t30,
|
|
3377
3427
|
children
|
|
3378
3428
|
] });
|
|
3379
|
-
$[
|
|
3380
|
-
$[
|
|
3381
|
-
$[
|
|
3429
|
+
$[70] = children;
|
|
3430
|
+
$[71] = t29;
|
|
3431
|
+
$[72] = t31;
|
|
3382
3432
|
} else {
|
|
3383
|
-
|
|
3433
|
+
t31 = $[72];
|
|
3384
3434
|
}
|
|
3385
|
-
return
|
|
3435
|
+
return t31;
|
|
3436
|
+
}
|
|
3437
|
+
function _temp6(acc_0, n_2) {
|
|
3438
|
+
return acc_0 + (n_2.seenAt ? 0 : 1);
|
|
3386
3439
|
}
|
|
3387
|
-
function _temp5(
|
|
3388
|
-
return
|
|
3440
|
+
function _temp5(acc, n_1) {
|
|
3441
|
+
return acc + (n_1.readAt ? 0 : 1);
|
|
3389
3442
|
}
|
|
3390
|
-
function _temp4(
|
|
3391
|
-
return
|
|
3443
|
+
function _temp4(n_0) {
|
|
3444
|
+
return Boolean(n_0);
|
|
3392
3445
|
}
|
|
3393
|
-
function _temp3(
|
|
3394
|
-
return
|
|
3446
|
+
function _temp3(doc_0) {
|
|
3447
|
+
return toNotificationItem(doc_0);
|
|
3395
3448
|
}
|
|
3396
3449
|
function _temp2(n) {
|
|
3397
3450
|
return Boolean(n);
|