1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00

chore: upgrade to mithril 2.2 (#3831)

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
Sami Mazouz
2023-06-15 18:04:41 +01:00
committed by GitHub
parent 493ffa0538
commit 11b4a810b7
8 changed files with 25 additions and 28 deletions

View File

@@ -58,12 +58,7 @@ export default class PostMention extends MentionableModel<Post, AtMentionFormat>
suggestion(model: Post, typed: string): Mithril.Children {
const user = model.user() || null;
const username = usernameHelper(user);
if (typed) {
username.children = [highlight((username.text ?? '') as string, typed)];
delete username.text;
}
const username = usernameHelper(user, (name: string) => highlight(name, typed));
return (
<>

View File

@@ -42,12 +42,7 @@ export default class UserMention extends MentionableModel<User, AtMentionFormat>
}
suggestion(model: User, typed: string): Mithril.Children {
const username = usernameHelper(model);
if (typed) {
username.children = [highlight((username.text ?? '') as string, typed)];
delete username.text;
}
const username = usernameHelper(model, (name: string) => highlight(name, typed));
return (
<>