From cdf9a036046ba7651c8c82bbf8e35e5ae24f4500 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 17 Feb 2023 00:19:29 -0800 Subject: [PATCH] chore: formatting --- packages/backend/src/misc/reaction-lib.ts | 33 +++++----- .../server/api/endpoints/channels/followed.ts | 16 +++-- .../src/components/global/MkPageHeader.vue | 63 ++++++++++--------- 3 files changed, 61 insertions(+), 51 deletions(-) diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index 7d78904bba..e25b2d6614 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -5,17 +5,17 @@ import { toPunyNullable } from "./convert-host.js"; import { IsNull } from "typeorm"; const legacies = new Map([ - ['like', '👍'], - ['love', '❤️'], - ['laugh', '😆'], - ['hmm', '🤔'], - ['surprise', '😮'], - ['congrats', '🎉'], - ['angry', '💢'], - ['confused', '😥'], - ['rip', '😇'], - ['pudding', '🍮'], - ['star', '⭐'], + ["like", "👍"], + ["love", "❤️"], + ["laugh", "😆"], + ["hmm", "🤔"], + ["surprise", "😮"], + ["congrats", "🎉"], + ["angry", "💢"], + ["confused", "😥"], + ["rip", "😇"], + ["pudding", "🍮"], + ["star", "⭐"], ]); export async function getFallbackReaction() { @@ -42,7 +42,10 @@ export function convertLegacyReactions(reactions: Record) { if (emoji) { _reactions.set(emoji, (_reactions.get(emoji) || 0) + reactions[reaction]); } else { - _reactions.set(reaction, (_reactions.get(reaction) || 0) + reactions[reaction]); + _reactions.set( + reaction, + (_reactions.get(reaction) || 0) + reactions[reaction], + ); } } @@ -127,7 +130,7 @@ export function decodeReaction(str: string): DecodedReaction { } export function convertLegacyReaction(reaction: string): string { - const decoded = decodeReaction(reaction).reaction; - if (legacies.has(decoded)) return legacies.get(decoded)!; - return decoded; + const decoded = decodeReaction(reaction).reaction; + if (legacies.has(decoded)) return legacies.get(decoded)!; + return decoded; } diff --git a/packages/backend/src/server/api/endpoints/channels/followed.ts b/packages/backend/src/server/api/endpoints/channels/followed.ts index f9e61222fc..993a211f7e 100644 --- a/packages/backend/src/server/api/endpoints/channels/followed.ts +++ b/packages/backend/src/server/api/endpoints/channels/followed.ts @@ -32,17 +32,23 @@ export const paramDef = { } as const; export default define(meta, paramDef, async (ps, me) => { - const query = ChannelFollowings.createQueryBuilder('following').andWhere({ followerId: me.id }); + const query = ChannelFollowings.createQueryBuilder("following").andWhere({ + followerId: me.id, + }); if (ps.sinceId) { - query.andWhere('following."followeeId" > :sinceId', { sinceId: ps.sinceId }); + query.andWhere('following."followeeId" > :sinceId', { + sinceId: ps.sinceId, + }); } if (ps.untilId) { - query.andWhere('following."followeeId" < :untilId', { untilId: ps.untilId }); + query.andWhere('following."followeeId" < :untilId', { + untilId: ps.untilId, + }); } if (ps.sinceId && !ps.untilId) { - query.orderBy('following."followeeId"', 'ASC'); + query.orderBy('following."followeeId"', "ASC"); } else { - query.orderBy('following."followeeId"', 'DESC'); + query.orderBy('following."followeeId"', "DESC"); } const followings = await query.take(ps.limit).getMany(); diff --git a/packages/client/src/components/global/MkPageHeader.vue b/packages/client/src/components/global/MkPageHeader.vue index 8fa3edfe1e..3b844bd82d 100644 --- a/packages/client/src/components/global/MkPageHeader.vue +++ b/packages/client/src/components/global/MkPageHeader.vue @@ -1,35 +1,36 @@