Skip to content

Commit 3551162

Browse files
Gargronhiyuki2578
authored andcommitted
Fix featured tags not finding the right tag on save (mastodon#11504)
Regression from f371b32
1 parent be59814 commit 3551162

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

app/javascript/styles/mastodon/widgets.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@
324324
&.active h4 {
325325
&,
326326
.fa,
327-
small {
327+
small,
328+
.trends__item__current {
328329
color: $primary-text-color;
329330
}
330331
}
@@ -337,6 +338,10 @@
337338
&.active .avatar-stack .account__avatar {
338339
border-color: $ui-highlight-color;
339340
}
341+
342+
.trends__item__current {
343+
padding-right: 0;
344+
}
340345
}
341346
}
342347

app/models/featured_tag.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FeaturedTag < ApplicationRecord
2323
validate :validate_featured_tags_limit, on: :create
2424

2525
def name=(str)
26-
self.tag = Tag.find_or_initialize_by(name: str.strip.delete('#').mb_chars.downcase.to_s)
26+
self.tag = Tag.find_or_create_by_names(str.strip)&.first
2727
end
2828

2929
def increment(timestamp)

0 commit comments

Comments
 (0)