mirror of
https://github.com/flarum/framework.git
synced 2025-02-23 21:50:56 +08:00
Fix tag change event posts with deleted tags erroring (#66)
Fixes #1864
This commit is contained in:
parent
7832c7c48c
commit
e59c54eae0
@ -6,7 +6,7 @@ export default function tagLabel(tag, attrs = {}) {
|
||||
attrs.className = 'TagLabel ' + (attrs.className || '');
|
||||
|
||||
const link = extract(attrs, 'link');
|
||||
let tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');
|
||||
const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');
|
||||
|
||||
if (tag) {
|
||||
const color = tag.color();
|
||||
@ -23,10 +23,11 @@ export default function tagLabel(tag, attrs = {}) {
|
||||
} else {
|
||||
attrs.className += ' untagged';
|
||||
}
|
||||
|
||||
return (
|
||||
m((link ? 'a' : 'span'), attrs,
|
||||
<span className="TagLabel-text">
|
||||
{tag.icon() && tagIcon(tag, {}, {useColor: false})} {tagText}
|
||||
{tag && tag.icon() && tagIcon(tag, {}, {useColor: false})} {tagText}
|
||||
</span>
|
||||
)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user