mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 19:33:11 +08:00
Fix error when rendering deleted user
This commit is contained in:
parent
360b503357
commit
67ffd8efd7
@ -63,8 +63,10 @@ export default function mentionedByList() {
|
|||||||
// replied twice, they will only be in this array once.
|
// replied twice, they will only be in this array once.
|
||||||
var used = [];
|
var used = [];
|
||||||
var repliers = replies.filter(reply => {
|
var repliers = replies.filter(reply => {
|
||||||
if (used.indexOf(reply.user().id()) === -1) {
|
var user = reply.user();
|
||||||
used.push(reply.user().id());
|
var id = user && user.id();
|
||||||
|
if (used.indexOf(id) === -1) {
|
||||||
|
used.push(id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -79,7 +81,7 @@ export default function mentionedByList() {
|
|||||||
onclick: hidePreview,
|
onclick: hidePreview,
|
||||||
'data-number': reply.number()
|
'data-number': reply.number()
|
||||||
}, [
|
}, [
|
||||||
reply.user() === app.session.user() ? 'You' : username(reply.user())
|
app.session.user() && reply.user() === app.session.user() ? 'You' : username(reply.user())
|
||||||
])
|
])
|
||||||
})),
|
})),
|
||||||
' replied to this.'
|
' replied to this.'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user