mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +02:00
fix: JS errors
This commit is contained in:
@@ -8,6 +8,7 @@ import username from '../../common/helpers/username';
|
|||||||
import highlight from '../../common/helpers/highlight';
|
import highlight from '../../common/helpers/highlight';
|
||||||
import classList from '../../common/utils/classList';
|
import classList from '../../common/utils/classList';
|
||||||
import type Mithril from 'mithril';
|
import type Mithril from 'mithril';
|
||||||
|
import type ForumApplication from '../../forum/ForumApplication';
|
||||||
|
|
||||||
export interface IUserSearchResultAttrs extends ComponentAttrs {
|
export interface IUserSearchResultAttrs extends ComponentAttrs {
|
||||||
user: User;
|
user: User;
|
||||||
@@ -26,7 +27,17 @@ export default class UserSearchResult<CustomAttrs extends IUserSearchResultAttrs
|
|||||||
data-id={user.id()}
|
data-id={user.id()}
|
||||||
onclick={this.attrs.onclick}
|
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>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
import Forum from './ForumApplication';
|
import Forum from './ForumApplication';
|
||||||
|
|
||||||
console.error('No');
|
|
||||||
|
|
||||||
const app = new Forum();
|
const app = new Forum();
|
||||||
|
|
||||||
// @ts-expect-error We need to do this for backwards compatibility purposes.
|
// @ts-expect-error We need to do this for backwards compatibility purposes.
|
||||||
|
Reference in New Issue
Block a user