Skip to content

Commit

Permalink
fix: Reset applied tags in selectbox when fetching
Browse files Browse the repository at this point in the history
Whenever we get new applied tags from the backend, we reset the applied
tags that are checked, and only check the explicit tags. This was
causing an issue of duplicate applied tags being added to the selectbox.
  • Loading branch information
yusuf-musleh committed Mar 13, 2024
1 parent c58e012 commit 234afac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/content-tags-drawer/ContentTagsCollapsibleHelper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,12 @@ const useContentTagsCollapsibleHelper = (

// Populating the SelectableBox with "selected" (explicit) tags
const value = item.lineage.map(l => encodeURIComponent(l)).join(',');
// eslint-disable-next-line no-unused-expressions
isExplicit ? add(value) : remove(value);
// Clear all the existing applied tags
remove(value);
// Add only the explicitly applied tags
if (isExplicit) {
add(value);
}
contentTagsCounter += 1;
}

Expand Down

0 comments on commit 234afac

Please sign in to comment.