chore: 🎨 format
This commit is contained in:
parent
d9274de0a7
commit
6e8aa76f2d
2 changed files with 4 additions and 7 deletions
|
@ -13,10 +13,10 @@ export function convertReactions(reactions: Record<string, number>) {
|
||||||
const result = new Map();
|
const result = new Map();
|
||||||
|
|
||||||
for (const reaction in reactions) {
|
for (const reaction in reactions) {
|
||||||
if (reactions[reaction] <= 0) continue;
|
if (reactions[reaction] <= 0) continue;
|
||||||
|
|
||||||
const decoded = decodeReaction(reaction).reaction;
|
const decoded = decodeReaction(reaction).reaction;
|
||||||
result.set(decoded, (result.get(decoded) || 0) + reactions[reaction]);
|
result.set(decoded, (result.get(decoded) || 0) + reactions[reaction]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.fromEntries(result);
|
return Object.fromEntries(result);
|
||||||
|
|
|
@ -14,10 +14,7 @@ import {
|
||||||
import type { Packed } from "@/misc/schema.js";
|
import type { Packed } from "@/misc/schema.js";
|
||||||
import { nyaize } from "@/misc/nyaize.js";
|
import { nyaize } from "@/misc/nyaize.js";
|
||||||
import { awaitAll } from "@/prelude/await-all.js";
|
import { awaitAll } from "@/prelude/await-all.js";
|
||||||
import {
|
import { convertReactions, decodeReaction } from "@/misc/reaction-lib.js";
|
||||||
convertReactions,
|
|
||||||
decodeReaction,
|
|
||||||
} from "@/misc/reaction-lib.js";
|
|
||||||
import type { NoteReaction } from "@/models/entities/note-reaction.js";
|
import type { NoteReaction } from "@/models/entities/note-reaction.js";
|
||||||
import {
|
import {
|
||||||
aggregateNoteEmojis,
|
aggregateNoteEmojis,
|
||||||
|
|
Loading…
Reference in a new issue