fix(client): fix broken IgnoredFilesPage notifications
This commit is contained in:
parent
0bb6d4d4df
commit
78f87d49ef
|
|
@ -87,7 +87,7 @@ const IgnoredFilesPage: React.FC = () => {
|
||||||
const [selectedFiles, setSelectedFiles] = useState<Set<string>>(new Set());
|
const [selectedFiles, setSelectedFiles] = useState<Set<string>>(new Set());
|
||||||
const [bulkDeleteDialog, setBulkDeleteDialog] = useState(false);
|
const [bulkDeleteDialog, setBulkDeleteDialog] = useState(false);
|
||||||
const [deletingFiles, setDeletingFiles] = useState(false);
|
const [deletingFiles, setDeletingFiles] = useState(false);
|
||||||
const { showNotification } = useNotifications();
|
const { addNotification } = useNotifications();
|
||||||
|
|
||||||
const pageSize = 25;
|
const pageSize = 25;
|
||||||
|
|
||||||
|
|
@ -216,13 +216,21 @@ const IgnoredFilesPage: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
showNotification('success', data.message);
|
addNotification({
|
||||||
|
type: 'success',
|
||||||
|
title: 'Files Deleted',
|
||||||
|
message: data.message
|
||||||
|
});
|
||||||
setSelectedFiles(new Set());
|
setSelectedFiles(new Set());
|
||||||
setBulkDeleteDialog(false);
|
setBulkDeleteDialog(false);
|
||||||
fetchIgnoredFiles();
|
fetchIgnoredFiles();
|
||||||
fetchStats();
|
fetchStats();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showNotification('error', err instanceof Error ? err.message : 'Failed to delete ignored files');
|
addNotification({
|
||||||
|
type: 'error',
|
||||||
|
title: 'Delete Failed',
|
||||||
|
message: err instanceof Error ? err.message : 'Failed to delete ignored files'
|
||||||
|
});
|
||||||
} finally {
|
} finally {
|
||||||
setDeletingFiles(false);
|
setDeletingFiles(false);
|
||||||
}
|
}
|
||||||
|
|
@ -248,11 +256,19 @@ const IgnoredFilesPage: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
showNotification('success', data.message);
|
addNotification({
|
||||||
|
type: 'success',
|
||||||
|
title: 'Files Deleted',
|
||||||
|
message: data.message
|
||||||
|
});
|
||||||
fetchIgnoredFiles();
|
fetchIgnoredFiles();
|
||||||
fetchStats();
|
fetchStats();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showNotification('error', err instanceof Error ? err.message : 'Failed to delete ignored file');
|
addNotification({
|
||||||
|
type: 'error',
|
||||||
|
title: 'Delete Failed',
|
||||||
|
message: err instanceof Error ? err.message : 'Failed to delete ignored file'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue