hide select button for notification when notification list is null
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "no-copy-frontend",
|
||||
"version": "0.111.0",
|
||||
"version": "0.112.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -p 2999",
|
||||
|
||||
@@ -81,28 +81,30 @@ export function NotificationsList() {
|
||||
</>
|
||||
)}
|
||||
|
||||
<button
|
||||
className="btn btn-primary"
|
||||
onClick={() => {
|
||||
if (allNotificationSelectedOnPage) {
|
||||
{allNotifications?.notifications.length !== 0 && (
|
||||
<button
|
||||
className="btn btn-primary"
|
||||
onClick={() => {
|
||||
if (allNotificationSelectedOnPage) {
|
||||
|
||||
const newSelection = { ...rowSelection };
|
||||
currentPageRows.forEach(row => {
|
||||
delete newSelection[row.original.id];
|
||||
});
|
||||
setRowSelection(newSelection);
|
||||
} else {
|
||||
const newSelection = { ...rowSelection };
|
||||
currentPageRows.forEach(row => {
|
||||
delete newSelection[row.original.id];
|
||||
});
|
||||
setRowSelection(newSelection);
|
||||
} else {
|
||||
|
||||
const newSelection = { ...rowSelection };
|
||||
currentPageRows.forEach(row => {
|
||||
newSelection[row.original.id] = true;
|
||||
});
|
||||
setRowSelection(newSelection);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{allNotificationSelectedOnPage ? t('deselect') : t('select-all')}
|
||||
</button>
|
||||
const newSelection = { ...rowSelection };
|
||||
currentPageRows.forEach(row => {
|
||||
newSelection[row.original.id] = true;
|
||||
});
|
||||
setRowSelection(newSelection);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{allNotificationSelectedOnPage ? t('deselect') : t('select-all')}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user