mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 09:42:43 +00:00
Merge branch 'experimentalNotificationDB' of https://github.com/G-Ambatte/homebrewery into pr/2586
This commit is contained in:
@@ -31,7 +31,6 @@ const NotificationDetail = ({ notification, onDelete })=>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const NotificationLookup = ()=>{
|
const NotificationLookup = ()=>{
|
||||||
const [foundNotification, setFoundNotification] = useState(null);
|
|
||||||
const [searching, setSearching] = useState(false);
|
const [searching, setSearching] = useState(false);
|
||||||
const [error, setError] = useState(null);
|
const [error, setError] = useState(null);
|
||||||
const [notifications, setNotifications] = useState([]);
|
const [notifications, setNotifications] = useState([]);
|
||||||
@@ -64,10 +63,6 @@ const NotificationLookup = ()=>{
|
|||||||
console.log('Delete notification confirm');
|
console.log('Delete notification confirm');
|
||||||
try {
|
try {
|
||||||
await request.delete(`/admin/notification/delete/${dismissKey}`);
|
await request.delete(`/admin/notification/delete/${dismissKey}`);
|
||||||
// Only reset the foundNotification if it matches the one being deleted
|
|
||||||
if(foundNotification && foundNotification.dismissKey === dismissKey) {
|
|
||||||
setFoundNotification(null);
|
|
||||||
}
|
|
||||||
lookupAll();
|
lookupAll();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user