upd: add additional check to visibility selector for boost

This commit is contained in:
Mar0xy 2023-12-04 00:26:47 +01:00
parent fb75282ea8
commit d586d1e6f8
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
6 changed files with 10 additions and 10 deletions

View file

@ -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) {

View file

@ -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', {

View file

@ -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;

View file

@ -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) {

View file

@ -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', {

View file

@ -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;