FIX: Ensure clicking a card loads the user page (#8)

This commit is contained in:
David Taylor 2022-10-17 10:06:20 +01:00 committed by GitHub
parent 02e70aad1c
commit d7d4687caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1,8 +1,9 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import discourseComputed from "discourse-common/utils/decorators";
import User from "discourse/models/user";
import EmberObject from "@ember/object";
import EmberObject, { action } from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import DiscourseURL, { userPath } from "discourse/lib/url";
export default {
name: "user-card-directory",
@ -107,6 +108,11 @@ export default {
return userCardInfos;
},
@action
userCardShowUser(user) {
DiscourseURL.routeTo(userPath(user.username_lower));
},
});
});
},

View File

@ -71,6 +71,7 @@
visible=true
loading=userCard.loading
username=userCard.user.username
showUser=this.userCardShowUser
}}
{{#if (theme-setting "show_stats")}}
<div class="user-card-directory-footer">