mirror of
https://github.com/flarum/framework.git
synced 2025-02-13 00:47:30 +08:00
fix: JS errors
This commit is contained in:
parent
ae03e6d473
commit
5ff66fd033
|
@ -8,6 +8,7 @@ import username from '../../common/helpers/username';
|
|||
import highlight from '../../common/helpers/highlight';
|
||||
import classList from '../../common/utils/classList';
|
||||
import type Mithril from 'mithril';
|
||||
import type ForumApplication from '../../forum/ForumApplication';
|
||||
|
||||
export interface IUserSearchResultAttrs extends ComponentAttrs {
|
||||
user: User;
|
||||
|
@ -26,7 +27,17 @@ export default class UserSearchResult<CustomAttrs extends IUserSearchResultAttrs
|
|||
data-id={user.id()}
|
||||
onclick={this.attrs.onclick}
|
||||
>
|
||||
{this.attrs.onclick ? <button type="button">{this.content(vnode)}</button> : <Link href={app.route.user(user)}>{this.content(vnode)}</Link>}
|
||||
{this.attrs.onclick ? (
|
||||
<button type="button">{this.content(vnode)}</button>
|
||||
) : (
|
||||
<Link
|
||||
href={
|
||||
'user' in app.route ? (app as unknown as ForumApplication).route.user(user) : app.forum.attribute('baseUrl') + '/u/' + user.username()
|
||||
}
|
||||
>
|
||||
{this.content(vnode)}
|
||||
</Link>
|
||||
)}
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import Forum from './ForumApplication';
|
||||
|
||||
console.error('No');
|
||||
|
||||
const app = new Forum();
|
||||
|
||||
// @ts-expect-error We need to do this for backwards compatibility purposes.
|
||||
|
|
Loading…
Reference in New Issue
Block a user