resolve issues with new features
This commit is contained in:
@@ -138,6 +138,15 @@ const NotificationBell: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleDeleteAllRead = async () => {
|
||||
try {
|
||||
await notificationsApi.deleteAllRead();
|
||||
setNotifications((prev) => prev.filter((n) => !n.gelesen));
|
||||
} catch {
|
||||
// non-critical
|
||||
}
|
||||
};
|
||||
|
||||
const open = Boolean(anchorEl);
|
||||
const hasUnread = unreadCount > 0;
|
||||
|
||||
@@ -169,11 +178,18 @@ const NotificationBell: React.FC = () => {
|
||||
<Typography variant="subtitle1" fontWeight={600}>
|
||||
Benachrichtigungen
|
||||
</Typography>
|
||||
{unreadCount > 0 && (
|
||||
<Button size="small" onClick={handleMarkAllRead} sx={{ fontSize: '0.75rem' }}>
|
||||
Alle als gelesen markieren
|
||||
</Button>
|
||||
)}
|
||||
<Box sx={{ display: 'flex', gap: 0.5 }}>
|
||||
{notifications.some((n) => n.gelesen) && (
|
||||
<Button size="small" onClick={handleDeleteAllRead} sx={{ fontSize: '0.75rem' }}>
|
||||
Gelesene löschen
|
||||
</Button>
|
||||
)}
|
||||
{unreadCount > 0 && (
|
||||
<Button size="small" onClick={handleMarkAllRead} sx={{ fontSize: '0.75rem' }}>
|
||||
Alle als gelesen markieren
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
<Divider />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user