From f2ffe0742567d3a62f151252ff7ef5262d04cbd4 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 7 May 2023 12:29:02 -0700 Subject: [PATCH] chore: formatting --- packages/backend/src/remote/activitypub/renderer/note.ts | 2 +- packages/backend/src/services/note/create.ts | 3 +-- packages/backend/src/services/note/reaction/create.ts | 5 +---- packages/client/src/components/MkRenoteButton.vue | 9 ++++++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/backend/src/remote/activitypub/renderer/note.ts b/packages/backend/src/remote/activitypub/renderer/note.ts index 5fe59b3ab7..280205eaf8 100644 --- a/packages/backend/src/remote/activitypub/renderer/note.ts +++ b/packages/backend/src/remote/activitypub/renderer/note.ts @@ -16,7 +16,7 @@ export default async function renderNote( dive = true, isTalk = false, ): Promise> { - note.visibility = note.visibility === "hidden" ? "home" : note.visibility; + note.visibility = note.visibility === "hidden" ? "home" : note.visibility; const getPromisedFiles = async (ids: string[]) => { if (!ids || ids.length === 0) return []; const items = await DriveFiles.findBy({ id: In(ids) }); diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 2a7b00b0fb..721147dd6b 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -606,8 +606,7 @@ export default async ( }); async function renderNoteOrRenoteActivity(data: Option, note: Note) { - if (data.localOnly || - note.visibility !== "hidden") return null; + if (data.localOnly || note.visibility !== "hidden") return null; const content = data.renote && diff --git a/packages/backend/src/services/note/reaction/create.ts b/packages/backend/src/services/note/reaction/create.ts index 9f4ed1375b..277393eb41 100644 --- a/packages/backend/src/services/note/reaction/create.ts +++ b/packages/backend/src/services/note/reaction/create.ts @@ -144,10 +144,7 @@ export default async ( }); //#region deliver - if ( - Users.isLocalUser(user) && - !note.localOnly - ) { + if (Users.isLocalUser(user) && !note.localOnly) { const content = renderActivity(await renderLike(record, note)); const dm = new DeliverManager(user, content); if (note.userHost !== null) { diff --git a/packages/client/src/components/MkRenoteButton.vue b/packages/client/src/components/MkRenoteButton.vue index ea01fcdc0a..b70edda7d5 100644 --- a/packages/client/src/components/MkRenoteButton.vue +++ b/packages/client/src/components/MkRenoteButton.vue @@ -35,7 +35,7 @@ const buttonRef = ref(); const canRenote = computed( () => - ["public", "home","hidden"].includes(props.note.visibility) || + ["public", "home", "hidden"].includes(props.note.visibility) || props.note.userId === $i.id ); @@ -75,7 +75,10 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { let buttonActions = []; - if (props.note.visibility === "public" || props.note.visibility === "hidden") { + if ( + props.note.visibility === "public" || + props.note.visibility === "hidden" + ) { buttonActions.push({ text: i18n.ts.renote, textStyle: "font-weight: bold", @@ -102,7 +105,7 @@ const renote = async (viaKeyboard = false, ev?: MouseEvent) => { }); } - if (["public", "home","hidden"].includes(props.note.visibility)) { + if (["public", "home", "hidden"].includes(props.note.visibility)) { buttonActions.push({ text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`, icon: "ph-house ph-bold ph-lg",