From 0df6cc5395d617f24a13f741c3556af1b79bec6c Mon Sep 17 00:00:00 2001 From: Andrey Onishchenko Date: Fri, 13 Feb 2026 19:32:10 +0300 Subject: [PATCH] fix: clear stale tag filter when tags are deleted Remove deleted tag IDs from the selected filter state when the available tags list changes. --- apps/dokploy/components/dashboard/projects/show.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/dokploy/components/dashboard/projects/show.tsx b/apps/dokploy/components/dashboard/projects/show.tsx index 770bb945a..4c08e1413 100644 --- a/apps/dokploy/components/dashboard/projects/show.tsx +++ b/apps/dokploy/components/dashboard/projects/show.tsx @@ -98,6 +98,15 @@ export const ShowProjects = () => { localStorage.setItem("projectsTagFilter", JSON.stringify(selectedTagIds)); }, [selectedTagIds]); + useEffect(() => { + if (!availableTags) return; + const validIds = new Set(availableTags.map((t) => t.tagId)); + setSelectedTagIds((prev) => { + const filtered = prev.filter((id) => validIds.has(id)); + return filtered.length === prev.length ? prev : filtered; + }); + }, [availableTags]); + useEffect(() => { if (!router.isReady) return; const urlQuery = typeof router.query.q === "string" ? router.query.q : "";