From d586d1e6f80e29a5ad6f02a5c487804024f16b37 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Mon, 4 Dec 2023 00:26:47 +0100 Subject: [PATCH] upd: add additional check to visibility selector for boost --- packages/frontend/src/components/MkNote.vue | 4 ++-- packages/frontend/src/components/MkNoteDetailed.vue | 4 ++-- packages/frontend/src/components/MkNoteSub.vue | 2 +- packages/frontend/src/components/SkNote.vue | 4 ++-- packages/frontend/src/components/SkNoteDetailed.vue | 4 ++-- packages/frontend/src/components/SkNoteSub.vue | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index b6d0d1af0a..dbbff650e0 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -449,9 +449,9 @@ function renote(visibility: Visibility | 'local') { const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility; const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; - let noteVisibility = visibility === 'local' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); + let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); if (appearNote.channel?.isSensitive) { - noteVisibility = smallerVisibility(visibility === 'local' ? appearNote.visibility : visibility, 'home'); + noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.visibility : visibility, 'home'); } if (!props.mock) { diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index ec60620208..34f782c269 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -495,9 +495,9 @@ function renote(visibility: Visibility | 'local') { const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility; const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; - let noteVisibility = visibility === 'local' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); + let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); if (appearNote.channel?.isSensitive) { - noteVisibility = smallerVisibility(visibility === 'local' ? appearNote.visibility : visibility, 'home'); + noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.visibility : visibility, 'home'); } os.api('notes/create', { diff --git a/packages/frontend/src/components/MkNoteSub.vue b/packages/frontend/src/components/MkNoteSub.vue index ce95444bc2..384a85e546 100644 --- a/packages/frontend/src/components/MkNoteSub.vue +++ b/packages/frontend/src/components/MkNoteSub.vue @@ -320,7 +320,7 @@ function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'loc os.api('notes/create', { renoteId: props.note.id, localOnly: visibility === 'local' ? true : false, - visibility: visibility === 'local' ? props.note.visibility : visibility, + visibility: visibility === 'local' || visibility === 'specified' ? props.note.visibility : visibility, }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true; diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue index 5bad52040e..b01e78c436 100644 --- a/packages/frontend/src/components/SkNote.vue +++ b/packages/frontend/src/components/SkNote.vue @@ -450,9 +450,9 @@ function renote(visibility: Visibility | 'local') { const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility; const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; - let noteVisibility = visibility === 'local' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); + let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); if (appearNote.channel?.isSensitive) { - noteVisibility = smallerVisibility(visibility === 'local' ? appearNote.visibility : visibility, 'home'); + noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.visibility : visibility, 'home'); } if (!props.mock) { diff --git a/packages/frontend/src/components/SkNoteDetailed.vue b/packages/frontend/src/components/SkNoteDetailed.vue index 85a6ed45ef..0db4e0a30b 100644 --- a/packages/frontend/src/components/SkNoteDetailed.vue +++ b/packages/frontend/src/components/SkNoteDetailed.vue @@ -503,9 +503,9 @@ function renote(visibility: Visibility | 'local') { const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility; const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; - let noteVisibility = visibility === 'local' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); + let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility); if (appearNote.channel?.isSensitive) { - noteVisibility = smallerVisibility(visibility === 'local' ? appearNote.visibility : visibility, 'home'); + noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.visibility : visibility, 'home'); } os.api('notes/create', { diff --git a/packages/frontend/src/components/SkNoteSub.vue b/packages/frontend/src/components/SkNoteSub.vue index cc44f42177..64c71efd4e 100644 --- a/packages/frontend/src/components/SkNoteSub.vue +++ b/packages/frontend/src/components/SkNoteSub.vue @@ -329,7 +329,7 @@ function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'loc os.api('notes/create', { renoteId: props.note.id, localOnly: visibility === 'local' ? true : false, - visibility: visibility === 'local' ? props.note.visibility : visibility, + visibility: visibility === 'local' || visibility === 'specified' ? props.note.visibility : visibility, }).then(() => { os.toast(i18n.ts.renoted); renoted.value = true;