Skip to content

Commit

Permalink
Filter empty tags when setting/submitting tags
Browse files Browse the repository at this point in the history
This fixes sending bad data to the backend when there is a trailing comma
  • Loading branch information
FinalDoom committed Jan 2, 2024
1 parent e20a2f0 commit 28b7fd3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const SetTagsModal: FC = () => {

const {selectedTorrents} = TorrentStore;
const formData = formRef.current.getFormData() as {tags: string};
const tags = formData.tags ? formData.tags.split(',') : [];
const tags = formData.tags ? formData.tags.split(',').filter(tag => !!tag) : [];

setIsSettingTags(true);

Expand Down

0 comments on commit 28b7fd3

Please sign in to comment.