From 0e22dcac4c2594d1d7353c28951cfc9f6f428120 Mon Sep 17 00:00:00 2001 From: Corban-Lee Date: Wed, 24 Jul 2024 22:49:09 +0100 Subject: [PATCH] toast improvements --- apps/static/js/home/content.js | 7 ++++++- apps/static/js/home/filters.js | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/apps/static/js/home/content.js b/apps/static/js/home/content.js index cde9716..15448c7 100644 --- a/apps/static/js/home/content.js +++ b/apps/static/js/home/content.js @@ -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 ${this.subscription.name} Subscription:

${this.guid}`, + 10000 + ); }); setTimeout(async () => { diff --git a/apps/static/js/home/filters.js b/apps/static/js/home/filters.js index 07c1bd8..092eacc 100644 --- a/apps/static/js/home/filters.js +++ b/apps/static/js/home/filters.js @@ -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 ${this.name} 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 ${row.name} has been erased.`, + 10000 + ); }); \ No newline at end of file