mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fixed broken empty state in mentions admin url (#16419)
fixes https://github.com/TryGhost/Team/issues/2734 With WebMentions flag on, navigating to `/ghost/#/mentions` on Admin when there are no mentions gives a 400 error page instead of the intended empty state.
This commit is contained in:
parent
7f223b56dd
commit
ef538428c9
1 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,12 @@ export default class MentionUtilsService extends Service {
|
|||
async loadGroupedMentions(mentions) {
|
||||
// Fetch mentions with the same source
|
||||
const sources = mentions.mapBy('source').uniq();
|
||||
const sourceMentions = await this.store.query('mention', {filter: `source:[${sources.map(s => `'${s}'`).join(',')}]`});
|
||||
let filter;
|
||||
if (sources.length > 0) {
|
||||
filter = `source:[${sources.map(s => `'${s}'`).join(',')}]`;
|
||||
}
|
||||
|
||||
const sourceMentions = await this.store.query('mention', {filter});
|
||||
mentions.forEach((mention) => {
|
||||
mention.set('mentions', sourceMentions.filterBy('source', mention.source));
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue