toast improvements

This commit is contained in:
Corban-Lee Jones 2024-07-24 22:49:09 +01:00
parent fbb1d4b37d
commit 0e22dcac4c
2 changed files with 20 additions and 3 deletions

View File

@ -152,7 +152,12 @@ async function deleteSelectedContent() {
var rows = contentTable.rows(".selected").data();
$.each(rows, async function() {
await deleteTrackedContent(this.id);
showToast("danger", "Deleted Tracked Content", "It can now appear be sent again. Content ID: " + this.id);
showToast(
"success",
"Deletion Successful",
`This content may appear again under the <b>${this.subscription.name}</b> Subscription:<br><br>${this.guid}`,
10000
);
});
setTimeout(async () => {

View File

@ -246,7 +246,12 @@ async function deleteSelectedFilters() {
var rows = filtersTable.rows(".selected").data();
$.each(rows, async function() {
await deleteFilter(this.id);
showToast("danger", "Deleted Filter", "Filter ID: " + this.id)
showToast(
"success",
"Deletion Successful",
`Content Filter <b>${this.name}</b> has been erased.`,
10000
);
})
setTimeout(async () => {
@ -258,8 +263,15 @@ async function deleteSelectedFilters() {
$("#deleteEditFilter").on("click", async function() {
const filterId = $("#filterId").val();
const row = filtersTable.row(function(index, row) {row.id == id}).data();
alert(filterId + JSON.stringify(row, null, 4))
await deleteFilter(filterId);
await loadFilters(getCurrentlyActiveServer().guild_id);
$("#filterFormModal").modal("hide");
showToast("danger", "Deleted Filter", "Filter ID: " + filterId);
showToast(
"success",
"Deletion Successful",
`Content Filter <b>${row.name}</b> has been erased.`,
10000
);
});