3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

!mutes fixes

This commit is contained in:
Dragory 2018-08-05 01:43:31 +03:00
parent 4a1a14be59
commit 741118d877

View file

@ -497,13 +497,13 @@ export class ModActionsPlugin extends Plugin {
if (a.expires_at == null && b.expires_at != null) return 1; if (a.expires_at == null && b.expires_at != null) return 1;
if (b.expires_at == null && a.expires_at != null) return -1; if (b.expires_at == null && a.expires_at != null) return -1;
if (a.expires_at == null && b.expires_at == null) { if (a.expires_at == null && b.expires_at == null) {
return a.created_at > b.created_at ? 1 : -1; return a.created_at > b.created_at ? -1 : 1;
} }
return a.expires_at > b.expires_at ? 1 : -1; return a.expires_at > b.expires_at ? 1 : -1;
}); });
const caseIds = activeMutes.map(m => m.case_id).filter(v => !!v); const caseIds = activeMutes.map(m => m.case_id).filter(v => !!v);
const cases = caseIds ? await this.cases.get(caseIds) : []; const cases = caseIds.length ? await this.cases.get(caseIds) : [];
const casesById = cases.reduce((map, c) => map.set(c.id, c), new Map()); const casesById = cases.reduce((map, c) => map.set(c.id, c), new Map());
lines.push( lines.push(