awing-library 2.1.56-beta → 2.1.58-beta
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.
|
@@ -44,12 +44,10 @@ var HeaderInfo = function (props) {
|
|
|
44
44
|
display: 'flex',
|
|
45
45
|
flexDirection: 'row',
|
|
46
46
|
justifyContent: 'space-between',
|
|
47
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", color: "inherit", noWrap: true, fontWeight: 'bold', children: t('Common.Notification') }), (0, jsx_runtime_1.jsx)(MenuNotification_1.default, { onUpdateMenuItem: handleUpdateMenuItem })] }), (0, jsx_runtime_1.jsx)(SearchBox_1.default, {
|
|
47
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { component: "h1", variant: "h5", color: "inherit", noWrap: true, fontWeight: 'bold', children: t('Common.Notification') }), (0, jsx_runtime_1.jsx)(MenuNotification_1.default, { onUpdateMenuItem: handleUpdateMenuItem })] }), (0, jsx_runtime_1.jsx)(SearchBox_1.default, { onSearch: handleKeyWordPassing, stylePaper: {
|
|
48
48
|
flex: 1,
|
|
49
49
|
width: 'auto',
|
|
50
50
|
maxWidth: '100%',
|
|
51
|
-
borderRadius: '24px',
|
|
52
|
-
padding: '2px 20px 2px 10px',
|
|
53
51
|
} }), (0, jsx_runtime_1.jsx)(ButtonTabs_1.default, { tabActive: valueFilter.tabs, onUpdateTabActive: handleUpdateTabActive })] }));
|
|
54
52
|
};
|
|
55
53
|
exports.default = HeaderInfo;
|
|
@@ -72,6 +72,7 @@ var NotificationDetail = function (props) {
|
|
|
72
72
|
var _b = react_1.default.useState(false), isLoading = _b[0], setIsLoading = _b[1];
|
|
73
73
|
var _c = react_1.default.useState(-1), count = _c[0], setCount = _c[1];
|
|
74
74
|
var _d = (0, react_1.useState)([]), notificationMessage = _d[0], setNotificationMessage = _d[1];
|
|
75
|
+
var totalItemCount = (0, react_1.useRef)(0);
|
|
75
76
|
(0, react_1.useEffect)(function () {
|
|
76
77
|
var observer = new IntersectionObserver(handleIntersection);
|
|
77
78
|
var lastItem = document.getElementById('last-Item');
|
|
@@ -86,7 +87,9 @@ var NotificationDetail = function (props) {
|
|
|
86
87
|
};
|
|
87
88
|
}, []);
|
|
88
89
|
(0, react_1.useEffect)(function () {
|
|
89
|
-
if (count >= 0
|
|
90
|
+
if (count >= 0 &&
|
|
91
|
+
(totalItemCount.current > notificationMessage.length ||
|
|
92
|
+
notificationMessage.length === 0)) {
|
|
90
93
|
setIsLoading(true);
|
|
91
94
|
service
|
|
92
95
|
.notificationsPaging(count, Constant_1.Constants.PAGE_SIZE_DEFAULT, valueFilter.textSearch, valueFilter.status, [])
|
|
@@ -97,6 +100,7 @@ var NotificationDetail = function (props) {
|
|
|
97
100
|
});
|
|
98
101
|
return __spreadArray(__spreadArray([], prevMessages, true), newItems, true);
|
|
99
102
|
});
|
|
103
|
+
totalItemCount.current = res.totalItemCount;
|
|
100
104
|
})
|
|
101
105
|
.finally(function () {
|
|
102
106
|
setIsLoading(false);
|
|
@@ -113,6 +117,7 @@ var NotificationDetail = function (props) {
|
|
|
113
117
|
var handleValueFilter = function (textSearch, tabs) {
|
|
114
118
|
textSearch.length === 0 ? setCount(0) : setCount(-1);
|
|
115
119
|
setNotificationMessage([]);
|
|
120
|
+
totalItemCount.current = 0;
|
|
116
121
|
setValueFilter({
|
|
117
122
|
textSearch: textSearch,
|
|
118
123
|
tabs: tabs,
|