diff --git a/src/pages/filters.jsx b/src/pages/filters.jsx index 7d11152d..a0c05118 100644 --- a/src/pages/filters.jsx +++ b/src/pages/filters.jsx @@ -180,6 +180,8 @@ function Filters() { ); } +let _id = 1; +const incID = () => _id++; function FiltersAddEdit({ filter, onClose }) { const { masto } = api(); const [uiState, setUIState] = useState('default'); @@ -193,7 +195,12 @@ function FiltersAddEdit({ filter, onClose }) { // Hacky way of handling removed keywords for both existing and new ones const [removedKeywordIDs, setRemovedKeywordIDs] = useState([]); - const [removedNewKeywordIndices, setRemovedNewKeywordIndices] = useState([]); + const [removedKeyword_IDs, setRemovedKeyword_IDs] = useState([]); + + const filteredEditKeywords = editKeywords.filter( + (k) => + !removedKeywordIDs.includes(k.id) && !removedKeyword_IDs.includes(k._id), + ); return (
@@ -335,16 +342,12 @@ function FiltersAddEdit({ filter, onClose }) {
- {editKeywords.length ? ( + {filteredEditKeywords.length ? (