mirror of
https://github.com/flarum/core.git
synced 2025-07-30 13:10:24 +02:00
Add Content for User page, preload user & throw 404 accordingly (#1901)
This commit is contained in:
committed by
Franz Liedke
parent
76f7d566b2
commit
02899d4f68
@@ -88,8 +88,13 @@ export default class UserPage extends Page {
|
||||
loadUser(username) {
|
||||
const lowercaseUsername = username.toLowerCase();
|
||||
|
||||
// Load the preloaded user object, if any, into the global app store
|
||||
// We don't use the output of the method because it returns raw JSON
|
||||
// instead of the parsed models
|
||||
app.preloadedApiDocument();
|
||||
|
||||
app.store.all('users').some(user => {
|
||||
if (user.username().toLowerCase() === lowercaseUsername && user.joinTime()) {
|
||||
if ((user.username().toLowerCase() === lowercaseUsername || user.id() === username) && user.joinTime()) {
|
||||
this.show(user);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user