Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
upd: add additional check to visibility selector for boost
Browse files Browse the repository at this point in the history
  • Loading branch information
Mar0xy committed Dec 3, 2023
1 parent fb75282 commit d586d1e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNoteSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/SkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/SkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/SkNoteSub.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d586d1e

Please sign in to comment.