From: Eugen Rochko Date: Wed, 9 Mar 2022 12:01:44 +0000 (+0100) Subject: Fix being able to add more than 4 hashtags to hashtag column in web UI (#17729) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=e54fd73df2f1b120e7986e161566802eb1aac464;p=mastodon.git Fix being able to add more than 4 hashtags to hashtag column in web UI (#17729) --- diff --git a/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js b/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js index 142118cef..ede8907e5 100644 --- a/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js +++ b/app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js @@ -40,7 +40,17 @@ class ColumnSettings extends React.PureComponent { } }; - onSelect = mode => value => this.props.onChange(['tags', mode], value); + onSelect = mode => value => { + const oldValue = this.tags(mode); + + // Prevent changes that add more than 4 tags, but allow removing + // tags that were already added before + if ((value.length > 4) && !(value < oldValue)) { + return; + } + + this.props.onChange(['tags', mode], value); + }; onToggle = () => { if (this.state.open && this.hasTags()) {