@replyke/core 7.0.0-beta.76 → 7.0.0-beta.77
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/cjs/hooks/app-notifications/useAppNotifications.js +8 -18
- package/dist/cjs/hooks/app-notifications/useAppNotifications.js.map +1 -1
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.d.ts +4 -2
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js +10 -15
- package/dist/cjs/hooks/app-notifications/useAppNotificationsActions.js.map +1 -1
- package/dist/esm/hooks/app-notifications/useAppNotifications.js +9 -19
- package/dist/esm/hooks/app-notifications/useAppNotifications.js.map +1 -1
- package/dist/esm/hooks/app-notifications/useAppNotificationsActions.d.ts +4 -2
- package/dist/esm/hooks/app-notifications/useAppNotificationsActions.js +11 -16
- package/dist/esm/hooks/app-notifications/useAppNotificationsActions.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ var appNotificationsSlice_1 = require("../../store/slices/appNotificationsSlice"
|
|
|
9
9
|
var useAppNotificationsActions_1 = require("./useAppNotificationsActions");
|
|
10
10
|
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
11
11
|
var user_1 = require("../user");
|
|
12
|
+
var addNotificationsMessages_1 = __importDefault(require("../../helpers/addNotificationsMessages"));
|
|
12
13
|
/**
|
|
13
14
|
* Redux-powered hook that provides the exact same interface as useAppNotificationsData()
|
|
14
15
|
* This is a drop-in replacement for the Context-based hook
|
|
@@ -26,8 +27,8 @@ function useAppNotifications(_a) {
|
|
|
26
27
|
var hasMore = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectAppNotificationsHasMore);
|
|
27
28
|
var currentPage = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectAppNotificationsPage);
|
|
28
29
|
var currentProjectId = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectCurrentProjectId);
|
|
29
|
-
// Get actions
|
|
30
|
-
var _d = (0, useAppNotificationsActions_1.useAppNotificationsActions)(
|
|
30
|
+
// Get actions (templates are applied at display time, not fetch time)
|
|
31
|
+
var _d = (0, useAppNotificationsActions_1.useAppNotificationsActions)(), loadMore = _d.loadMore, markNotificationAsRead = _d.markNotificationAsRead, markAllNotificationsAsRead = _d.markAllNotificationsAsRead, resetAppNotifications = _d.resetAppNotifications, fetchMoreNotifications = _d.fetchMoreNotifications, updateUnreadCount = _d.updateUnreadCount;
|
|
31
32
|
// Update Redux state when props change
|
|
32
33
|
(0, react_1.useEffect)(function () {
|
|
33
34
|
if (projectId && projectId !== currentProjectId) {
|
|
@@ -37,20 +38,6 @@ function useAppNotifications(_a) {
|
|
|
37
38
|
(0, react_1.useEffect)(function () {
|
|
38
39
|
dispatch((0, appNotificationsSlice_1.setLimit)(limit));
|
|
39
40
|
}, [dispatch, limit]);
|
|
40
|
-
// Prevent infinite re-renders by comparing current vs new templates
|
|
41
|
-
var currentTemplates = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectNotificationTemplates);
|
|
42
|
-
var templatesChanged = (0, react_1.useMemo)(function () {
|
|
43
|
-
// If no templates provided, skip comparison
|
|
44
|
-
if (!notificationTemplates)
|
|
45
|
-
return false;
|
|
46
|
-
// Deep comparison using JSON stringify
|
|
47
|
-
return (JSON.stringify(currentTemplates) !== JSON.stringify(notificationTemplates));
|
|
48
|
-
}, [currentTemplates, notificationTemplates]);
|
|
49
|
-
(0, react_1.useEffect)(function () {
|
|
50
|
-
if (notificationTemplates && templatesChanged) {
|
|
51
|
-
dispatch((0, appNotificationsSlice_1.setNotificationTemplates)(notificationTemplates));
|
|
52
|
-
}
|
|
53
|
-
}, [dispatch, notificationTemplates, templatesChanged]);
|
|
54
41
|
// Fetch unread count on mount and when dependencies change
|
|
55
42
|
(0, react_1.useEffect)(function () {
|
|
56
43
|
if (projectId && user) {
|
|
@@ -69,9 +56,12 @@ function useAppNotifications(_a) {
|
|
|
69
56
|
fetchMoreNotifications(currentPage);
|
|
70
57
|
}
|
|
71
58
|
}, [currentPage, fetchMoreNotifications, projectId, user]);
|
|
59
|
+
// Apply templates at display time (not at fetch time)
|
|
60
|
+
// This ensures templates are always applied fresh from props
|
|
61
|
+
var templatedNotifications = (0, react_1.useMemo)(function () { return (0, addNotificationsMessages_1.default)(appNotifications, notificationTemplates); }, [appNotifications, notificationTemplates]);
|
|
72
62
|
// Return the same interface as the original hook
|
|
73
63
|
return (0, react_1.useMemo)(function () { return ({
|
|
74
|
-
appNotifications:
|
|
64
|
+
appNotifications: templatedNotifications,
|
|
75
65
|
unreadAppNotificationsCount: unreadAppNotificationsCount,
|
|
76
66
|
loading: loading,
|
|
77
67
|
hasMore: hasMore,
|
|
@@ -80,7 +70,7 @@ function useAppNotifications(_a) {
|
|
|
80
70
|
markAllNotificationsAsRead: markAllNotificationsAsRead,
|
|
81
71
|
resetAppNotifications: resetAppNotifications,
|
|
82
72
|
}); }, [
|
|
83
|
-
|
|
73
|
+
templatedNotifications,
|
|
84
74
|
unreadAppNotificationsCount,
|
|
85
75
|
loading,
|
|
86
76
|
hasMore,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppNotifications.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotifications.ts"],"names":[],"mappings":";;;;;AAAA,+BAA2C;AAC3C,2CAA2E;AAE3E,
|
|
1
|
+
{"version":3,"file":"useAppNotifications.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotifications.ts"],"names":[],"mappings":";;;;;AAAA,+BAA2C;AAC3C,2CAA2E;AAE3E,kFASkD;AAClD,2EAA0E;AAC1E,sEAAgD;AAChD,gCAAkC;AAElC,oGAA8E;AAkB9E;;;GAGG;AACH,SAAS,mBAAmB,CAAC,EAGG;QAHH,qBAGC,EAAE,KAAA,EAF9B,aAAU,EAAV,KAAK,mBAAG,EAAE,KAAA,EACV,qBAAqB,2BAAA;IAErB,IAAM,QAAQ,GAAG,IAAA,0BAAkB,GAAE,CAAC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|
|
2
1
|
/**
|
|
3
2
|
* Hook that provides Redux-powered actions for app notifications
|
|
4
3
|
* Integrates RTK Query with Redux slice actions
|
|
4
|
+
*
|
|
5
|
+
* Note: Templates are applied at display time in useAppNotifications, not here.
|
|
6
|
+
* This ensures templates are always fresh and avoids race conditions.
|
|
5
7
|
*/
|
|
6
|
-
export declare function useAppNotificationsActions(
|
|
8
|
+
export declare function useAppNotificationsActions(): {
|
|
7
9
|
loadMore: () => void;
|
|
8
10
|
markNotificationAsRead: (notificationId: string) => Promise<void>;
|
|
9
11
|
markAllNotificationsAsRead: () => Promise<void>;
|
|
@@ -45,25 +45,22 @@ var hooks_1 = require("../../store/hooks");
|
|
|
45
45
|
var appNotificationsSlice_1 = require("../../store/slices/appNotificationsSlice");
|
|
46
46
|
var appNotificationsApi_1 = require("../../store/api/appNotificationsApi");
|
|
47
47
|
var handleError_1 = require("../../utils/handleError");
|
|
48
|
-
var addNotificationsMessages_1 = __importDefault(require("../../helpers/addNotificationsMessages"));
|
|
49
48
|
var useProject_1 = __importDefault(require("../projects/useProject"));
|
|
50
49
|
var user_1 = require("../user");
|
|
51
50
|
/**
|
|
52
51
|
* Hook that provides Redux-powered actions for app notifications
|
|
53
52
|
* Integrates RTK Query with Redux slice actions
|
|
53
|
+
*
|
|
54
|
+
* Note: Templates are applied at display time in useAppNotifications, not here.
|
|
55
|
+
* This ensures templates are always fresh and avoids race conditions.
|
|
54
56
|
*/
|
|
55
|
-
function useAppNotificationsActions(
|
|
56
|
-
// Optional templates override to avoid race conditions with Redux state
|
|
57
|
-
templatesOverride) {
|
|
57
|
+
function useAppNotificationsActions() {
|
|
58
58
|
var _this = this;
|
|
59
59
|
var dispatch = (0, hooks_1.useReplykeDispatch)();
|
|
60
60
|
// Get current state for actions
|
|
61
61
|
var projectIdFromSlice = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectCurrentProjectId);
|
|
62
62
|
var page = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectAppNotificationsPage);
|
|
63
63
|
var limit = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectAppNotificationsLimit);
|
|
64
|
-
var templatesFromRedux = (0, hooks_1.useReplykeSelector)(appNotificationsSlice_1.selectNotificationTemplates);
|
|
65
|
-
// Use override if provided, otherwise fall back to Redux state
|
|
66
|
-
var notificationTemplates = templatesOverride !== null && templatesOverride !== void 0 ? templatesOverride : templatesFromRedux;
|
|
67
64
|
// Get project and user context (fallback to current hooks)
|
|
68
65
|
var projectIdFromHook = (0, useProject_1.default)().projectId;
|
|
69
66
|
var user = (0, user_1.useUser)().user;
|
|
@@ -111,7 +108,7 @@ templatesOverride) {
|
|
|
111
108
|
}); }, [dispatch, projectId, user, markNotificationAsReadMutation]);
|
|
112
109
|
// Reset notifications action
|
|
113
110
|
var resetAppNotifications = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
114
|
-
var response, notifications, pagination,
|
|
111
|
+
var response, notifications, pagination, error_2;
|
|
115
112
|
return __generator(this, function (_a) {
|
|
116
113
|
switch (_a.label) {
|
|
117
114
|
case 0:
|
|
@@ -132,9 +129,9 @@ templatesOverride) {
|
|
|
132
129
|
response = _a.sent();
|
|
133
130
|
if (response) {
|
|
134
131
|
notifications = response.data, pagination = response.pagination;
|
|
135
|
-
|
|
132
|
+
// Store raw notifications - templates applied at display time
|
|
136
133
|
dispatch((0, appNotificationsSlice_1.addNotifications)({
|
|
137
|
-
notifications:
|
|
134
|
+
notifications: notifications,
|
|
138
135
|
hasMore: pagination.hasMore,
|
|
139
136
|
isFirstPage: true,
|
|
140
137
|
}));
|
|
@@ -153,11 +150,10 @@ templatesOverride) {
|
|
|
153
150
|
user,
|
|
154
151
|
triggerFetchNotifications,
|
|
155
152
|
limit,
|
|
156
|
-
notificationTemplates,
|
|
157
153
|
]);
|
|
158
154
|
// Fetch more notifications (internal action triggered by page changes)
|
|
159
155
|
var fetchMoreNotifications = (0, react_1.useCallback)(function (pageToFetch) { return __awaiter(_this, void 0, void 0, function () {
|
|
160
|
-
var response, notifications, pagination,
|
|
156
|
+
var response, notifications, pagination, error_3;
|
|
161
157
|
return __generator(this, function (_a) {
|
|
162
158
|
switch (_a.label) {
|
|
163
159
|
case 0:
|
|
@@ -176,9 +172,9 @@ templatesOverride) {
|
|
|
176
172
|
response = _a.sent();
|
|
177
173
|
if (response) {
|
|
178
174
|
notifications = response.data, pagination = response.pagination;
|
|
179
|
-
|
|
175
|
+
// Store raw notifications - templates applied at display time
|
|
180
176
|
dispatch((0, appNotificationsSlice_1.addNotifications)({
|
|
181
|
-
notifications:
|
|
177
|
+
notifications: notifications,
|
|
182
178
|
hasMore: pagination.hasMore,
|
|
183
179
|
}));
|
|
184
180
|
}
|
|
@@ -199,7 +195,6 @@ templatesOverride) {
|
|
|
199
195
|
user,
|
|
200
196
|
triggerFetchNotifications,
|
|
201
197
|
limit,
|
|
202
|
-
notificationTemplates,
|
|
203
198
|
]);
|
|
204
199
|
// Update unread count
|
|
205
200
|
var updateUnreadCount = (0, react_1.useCallback)(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppNotificationsActions.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotificationsActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,
|
|
1
|
+
{"version":3,"file":"useAppNotificationsActions.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotificationsActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,gEAyKC;AAxMD,+BAAoC;AACpC,2CAA2E;AAC3E,kFAWkD;AAClD,2EAK6C;AAC7C,uDAAsD;AACtD,sEAAgD;AAChD,gCAAkC;AAElC;;;;;;GAMG;AACH,SAAgB,0BAA0B;IAA1C,iBAyKC;IAxKC,IAAM,QAAQ,GAAG,IAAA,0BAAkB,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EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEpD,wCAAwC;IACxC,IAAM,0BAA0B,GAAG,IAAA,mBAAW,EAAC;;;;;oBAC7C,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC;wBACxB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;oBACnE,CAAC;;;;oBAGC,oBAAoB;oBACpB,QAAQ,CAAC,IAAA,4CAAoB,GAAE,CAAC,CAAC;oBAEjC,gBAAgB;oBAChB,qBAAM,kCAAkC,CAAC,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC,MAAM,EAAE,EAAA;;oBADhE,gBAAgB;oBAChB,SAAgE,CAAC;;;;oBAEjE,IAAA,yBAAW,EAAC,OAAK,EAAE,2CAA2C,CAAC,CAAC;oBAChE,MAAM,OAAK,CAAC;;;;SAEf,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,kCAAkC,CAAC,CAAC,CAAC;IAEpE,OAAO;QACL,QAAQ,UAAA;QACR,sBAAsB,wBAAA;QACtB,0BAA0B,4BAAA;QAC1B,qBAAqB,uBAAA;QACrB,sBAAsB,wBAAA,EAAE,kBAAkB;QAC1C,iBAAiB,mBAAA;KAClB,CAAC;AACJ,CAAC;AAED,kBAAe,0BAA0B,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useEffect, useMemo } from "react";
|
|
2
2
|
import { useReplykeDispatch, useReplykeSelector } from "../../store/hooks";
|
|
3
|
-
import { setProjectContext, setLimit,
|
|
3
|
+
import { setProjectContext, setLimit, selectAppNotifications, selectUnreadCount, selectAppNotificationsLoading, selectAppNotificationsHasMore, selectAppNotificationsPage, selectCurrentProjectId, } from "../../store/slices/appNotificationsSlice";
|
|
4
4
|
import { useAppNotificationsActions } from "./useAppNotificationsActions";
|
|
5
5
|
import useProject from "../projects/useProject";
|
|
6
6
|
import { useUser } from "../user";
|
|
7
|
+
import addNotificationsMessages from "../../helpers/addNotificationsMessages";
|
|
7
8
|
/**
|
|
8
9
|
* Redux-powered hook that provides the exact same interface as useAppNotificationsData()
|
|
9
10
|
* This is a drop-in replacement for the Context-based hook
|
|
@@ -21,8 +22,8 @@ function useAppNotifications(_a) {
|
|
|
21
22
|
var hasMore = useReplykeSelector(selectAppNotificationsHasMore);
|
|
22
23
|
var currentPage = useReplykeSelector(selectAppNotificationsPage);
|
|
23
24
|
var currentProjectId = useReplykeSelector(selectCurrentProjectId);
|
|
24
|
-
// Get actions
|
|
25
|
-
var _d = useAppNotificationsActions(
|
|
25
|
+
// Get actions (templates are applied at display time, not fetch time)
|
|
26
|
+
var _d = useAppNotificationsActions(), loadMore = _d.loadMore, markNotificationAsRead = _d.markNotificationAsRead, markAllNotificationsAsRead = _d.markAllNotificationsAsRead, resetAppNotifications = _d.resetAppNotifications, fetchMoreNotifications = _d.fetchMoreNotifications, updateUnreadCount = _d.updateUnreadCount;
|
|
26
27
|
// Update Redux state when props change
|
|
27
28
|
useEffect(function () {
|
|
28
29
|
if (projectId && projectId !== currentProjectId) {
|
|
@@ -32,20 +33,6 @@ function useAppNotifications(_a) {
|
|
|
32
33
|
useEffect(function () {
|
|
33
34
|
dispatch(setLimit(limit));
|
|
34
35
|
}, [dispatch, limit]);
|
|
35
|
-
// Prevent infinite re-renders by comparing current vs new templates
|
|
36
|
-
var currentTemplates = useReplykeSelector(selectNotificationTemplates);
|
|
37
|
-
var templatesChanged = useMemo(function () {
|
|
38
|
-
// If no templates provided, skip comparison
|
|
39
|
-
if (!notificationTemplates)
|
|
40
|
-
return false;
|
|
41
|
-
// Deep comparison using JSON stringify
|
|
42
|
-
return (JSON.stringify(currentTemplates) !== JSON.stringify(notificationTemplates));
|
|
43
|
-
}, [currentTemplates, notificationTemplates]);
|
|
44
|
-
useEffect(function () {
|
|
45
|
-
if (notificationTemplates && templatesChanged) {
|
|
46
|
-
dispatch(setNotificationTemplates(notificationTemplates));
|
|
47
|
-
}
|
|
48
|
-
}, [dispatch, notificationTemplates, templatesChanged]);
|
|
49
36
|
// Fetch unread count on mount and when dependencies change
|
|
50
37
|
useEffect(function () {
|
|
51
38
|
if (projectId && user) {
|
|
@@ -64,9 +51,12 @@ function useAppNotifications(_a) {
|
|
|
64
51
|
fetchMoreNotifications(currentPage);
|
|
65
52
|
}
|
|
66
53
|
}, [currentPage, fetchMoreNotifications, projectId, user]);
|
|
54
|
+
// Apply templates at display time (not at fetch time)
|
|
55
|
+
// This ensures templates are always applied fresh from props
|
|
56
|
+
var templatedNotifications = useMemo(function () { return addNotificationsMessages(appNotifications, notificationTemplates); }, [appNotifications, notificationTemplates]);
|
|
67
57
|
// Return the same interface as the original hook
|
|
68
58
|
return useMemo(function () { return ({
|
|
69
|
-
appNotifications:
|
|
59
|
+
appNotifications: templatedNotifications,
|
|
70
60
|
unreadAppNotificationsCount: unreadAppNotificationsCount,
|
|
71
61
|
loading: loading,
|
|
72
62
|
hasMore: hasMore,
|
|
@@ -75,7 +65,7 @@ function useAppNotifications(_a) {
|
|
|
75
65
|
markAllNotificationsAsRead: markAllNotificationsAsRead,
|
|
76
66
|
resetAppNotifications: resetAppNotifications,
|
|
77
67
|
}); }, [
|
|
78
|
-
|
|
68
|
+
templatedNotifications,
|
|
79
69
|
unreadAppNotificationsCount,
|
|
80
70
|
loading,
|
|
81
71
|
hasMore,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppNotifications.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"useAppNotifications.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotifications.ts"],"names":[],"mappings":"AAAA,OA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AAqB,CAAC,CAC1C,CAAC;IAEF,iDAAiD;IACjD,OAAO,OAAO,CACZ,cAAM,OAAA,CAAC;QACL,gBAAgB,EAAE,sBAAsB;QACxC,2BAA2B,6BAAA;QAC3B,OAAO,SAAA;QACP,OAAO,SAAA;QACP,QAAQ,UAAA;QACR,sBAAsB,wBAAA;QACtB,0BAA0B,4BAAA;QAC1B,qBAAqB,uBAAA;KACtB,CAAC,EATI,CASJ,EACF;QACE,sBAAsB;QACtB,2BAA2B;QAC3B,OAAO;QACP,OAAO;QACP,QAAQ;QACR,sBAAsB;QACtB,0BAA0B;QAC1B,qBAAqB;KACtB,CACF,CAAC;AACJ,CAAC;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { NotificationTemplates } from "../../interfaces/models/AppNotification";
|
|
2
1
|
/**
|
|
3
2
|
* Hook that provides Redux-powered actions for app notifications
|
|
4
3
|
* Integrates RTK Query with Redux slice actions
|
|
4
|
+
*
|
|
5
|
+
* Note: Templates are applied at display time in useAppNotifications, not here.
|
|
6
|
+
* This ensures templates are always fresh and avoids race conditions.
|
|
5
7
|
*/
|
|
6
|
-
export declare function useAppNotificationsActions(
|
|
8
|
+
export declare function useAppNotificationsActions(): {
|
|
7
9
|
loadMore: () => void;
|
|
8
10
|
markNotificationAsRead: (notificationId: string) => Promise<void>;
|
|
9
11
|
markAllNotificationsAsRead: () => Promise<void>;
|
|
@@ -36,28 +36,25 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { useCallback } from "react";
|
|
38
38
|
import { useReplykeDispatch, useReplykeSelector } from "../../store/hooks";
|
|
39
|
-
import { loadMore as loadMoreAction, resetNotifications, setLoading, addNotifications, markAsReadLocally, markAllAsReadLocally, setUnreadCount, selectCurrentProjectId, selectAppNotificationsPage, selectAppNotificationsLimit,
|
|
39
|
+
import { loadMore as loadMoreAction, resetNotifications, setLoading, addNotifications, markAsReadLocally, markAllAsReadLocally, setUnreadCount, selectCurrentProjectId, selectAppNotificationsPage, selectAppNotificationsLimit, } from "../../store/slices/appNotificationsSlice";
|
|
40
40
|
import { useLazyFetchAppNotificationsQuery, useMarkNotificationAsReadMutation, useMarkAllNotificationsAsReadMutation, useLazyCountUnreadNotificationsQuery, } from "../../store/api/appNotificationsApi";
|
|
41
41
|
import { handleError } from "../../utils/handleError";
|
|
42
|
-
import addNotificationsMessages from "../../helpers/addNotificationsMessages";
|
|
43
42
|
import useProject from "../projects/useProject";
|
|
44
43
|
import { useUser } from "../user";
|
|
45
44
|
/**
|
|
46
45
|
* Hook that provides Redux-powered actions for app notifications
|
|
47
46
|
* Integrates RTK Query with Redux slice actions
|
|
47
|
+
*
|
|
48
|
+
* Note: Templates are applied at display time in useAppNotifications, not here.
|
|
49
|
+
* This ensures templates are always fresh and avoids race conditions.
|
|
48
50
|
*/
|
|
49
|
-
export function useAppNotificationsActions(
|
|
50
|
-
// Optional templates override to avoid race conditions with Redux state
|
|
51
|
-
templatesOverride) {
|
|
51
|
+
export function useAppNotificationsActions() {
|
|
52
52
|
var _this = this;
|
|
53
53
|
var dispatch = useReplykeDispatch();
|
|
54
54
|
// Get current state for actions
|
|
55
55
|
var projectIdFromSlice = useReplykeSelector(selectCurrentProjectId);
|
|
56
56
|
var page = useReplykeSelector(selectAppNotificationsPage);
|
|
57
57
|
var limit = useReplykeSelector(selectAppNotificationsLimit);
|
|
58
|
-
var templatesFromRedux = useReplykeSelector(selectNotificationTemplates);
|
|
59
|
-
// Use override if provided, otherwise fall back to Redux state
|
|
60
|
-
var notificationTemplates = templatesOverride !== null && templatesOverride !== void 0 ? templatesOverride : templatesFromRedux;
|
|
61
58
|
// Get project and user context (fallback to current hooks)
|
|
62
59
|
var projectIdFromHook = useProject().projectId;
|
|
63
60
|
var user = useUser().user;
|
|
@@ -105,7 +102,7 @@ templatesOverride) {
|
|
|
105
102
|
}); }, [dispatch, projectId, user, markNotificationAsReadMutation]);
|
|
106
103
|
// Reset notifications action
|
|
107
104
|
var resetAppNotifications = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
108
|
-
var response, notifications, pagination,
|
|
105
|
+
var response, notifications, pagination, error_2;
|
|
109
106
|
return __generator(this, function (_a) {
|
|
110
107
|
switch (_a.label) {
|
|
111
108
|
case 0:
|
|
@@ -126,9 +123,9 @@ templatesOverride) {
|
|
|
126
123
|
response = _a.sent();
|
|
127
124
|
if (response) {
|
|
128
125
|
notifications = response.data, pagination = response.pagination;
|
|
129
|
-
|
|
126
|
+
// Store raw notifications - templates applied at display time
|
|
130
127
|
dispatch(addNotifications({
|
|
131
|
-
notifications:
|
|
128
|
+
notifications: notifications,
|
|
132
129
|
hasMore: pagination.hasMore,
|
|
133
130
|
isFirstPage: true,
|
|
134
131
|
}));
|
|
@@ -147,11 +144,10 @@ templatesOverride) {
|
|
|
147
144
|
user,
|
|
148
145
|
triggerFetchNotifications,
|
|
149
146
|
limit,
|
|
150
|
-
notificationTemplates,
|
|
151
147
|
]);
|
|
152
148
|
// Fetch more notifications (internal action triggered by page changes)
|
|
153
149
|
var fetchMoreNotifications = useCallback(function (pageToFetch) { return __awaiter(_this, void 0, void 0, function () {
|
|
154
|
-
var response, notifications, pagination,
|
|
150
|
+
var response, notifications, pagination, error_3;
|
|
155
151
|
return __generator(this, function (_a) {
|
|
156
152
|
switch (_a.label) {
|
|
157
153
|
case 0:
|
|
@@ -170,9 +166,9 @@ templatesOverride) {
|
|
|
170
166
|
response = _a.sent();
|
|
171
167
|
if (response) {
|
|
172
168
|
notifications = response.data, pagination = response.pagination;
|
|
173
|
-
|
|
169
|
+
// Store raw notifications - templates applied at display time
|
|
174
170
|
dispatch(addNotifications({
|
|
175
|
-
notifications:
|
|
171
|
+
notifications: notifications,
|
|
176
172
|
hasMore: pagination.hasMore,
|
|
177
173
|
}));
|
|
178
174
|
}
|
|
@@ -193,7 +189,6 @@ templatesOverride) {
|
|
|
193
189
|
user,
|
|
194
190
|
triggerFetchNotifications,
|
|
195
191
|
limit,
|
|
196
|
-
notificationTemplates,
|
|
197
192
|
]);
|
|
198
193
|
// Update unread count
|
|
199
194
|
var updateUnreadCount = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppNotificationsActions.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotificationsActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,QAAQ,IAAI,cAAc,EAC1B,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,
|
|
1
|
+
{"version":3,"file":"useAppNotificationsActions.js","sourceRoot":"","sources":["../../../../src/hooks/app-notifications/useAppNotificationsActions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,QAAQ,IAAI,cAAc,EAC1B,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,iCAAiC,EACjC,iCAAiC,EACjC,qCAAqC,EACrC,oCAAoC,GACrC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD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