mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-20 22:03:48 +00:00
feat(admin): native-feed detail group + dismissable notice
Wire the NativeFeeds chip group into the per-feed emails page, add a dismissable banner that nudges users to subscribe directly, the dismiss POST route mirroring the confirmation-dismiss idiom, and the client-side handler in emails-page.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -634,3 +634,22 @@ if (dismissBtn && banner) {
|
||||
.catch(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
// ── Native-feed banner dismiss ────────────────────────────────────────────────
|
||||
|
||||
const nativeDismissBtn = document.getElementById("native-feed-dismiss");
|
||||
const nativeBanner = document.getElementById("native-feed-banner");
|
||||
if (nativeDismissBtn && nativeBanner) {
|
||||
nativeDismissBtn.addEventListener("click", () => {
|
||||
const feedId = nativeBanner.getAttribute("data-feed-id") ?? "";
|
||||
fetch(`/admin/feeds/${feedId}/native-feed/dismiss`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.then((d) => {
|
||||
if ((d as { ok?: boolean }).ok) nativeBanner.remove();
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user