1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-23 14:46:44 +09:00
This commit is contained in:
NoriDev 2024-05-22 10:54:34 +09:00
parent f70275b42f
commit 40d6a58939

View File

@ -818,21 +818,20 @@ export function getRenoteMenu(props: {
}));
},
});
}
// Add visibility section
if (
defaultStore.state.renoteVisibilitySelection &&
!['followers', 'specified'].includes(appearNote.visibility) &&
(!appearNote.channel || appearNote.channel.allowRenoteToExternal)
!['followers', 'specified'].includes(appearNote.visibility)
) {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
// renote to public
if (appearNote.visibility === 'public') {
visibilityRenoteItems.push({
text: `${i18n.ts.renote} (${i18n.ts._visibility.public})`,
icon: 'ti ti-world',
action: () => {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
misskeyApi('notes/create', {
localOnly,
visibility: 'public',
@ -850,7 +849,6 @@ export function getRenoteMenu(props: {
text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`,
icon: 'ti ti-home',
action: () => {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
misskeyApi('notes/create', {
localOnly,
visibility: 'home',
@ -867,7 +865,6 @@ export function getRenoteMenu(props: {
text: `${i18n.ts.renote} (${i18n.ts._visibility.followers})`,
icon: 'ti ti-lock',
action: () => {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
misskeyApi('notes/create', {
localOnly,
visibility: 'followers',
@ -878,6 +875,7 @@ export function getRenoteMenu(props: {
},
});
}
}
const renoteItems = addDividersBetweenMenuSections(
normalRenoteItems,
@ -960,18 +958,15 @@ export async function getRenoteOnly(props: {
os.toast(i18n.ts.renoted, 'renote');
});
}
}
// Add visibility section
if (
!defaultStore.state.renoteVisibilitySelection &&
defaultStore.state.forceRenoteVisibilitySelection !== 'none' &&
!['followers', 'specified'].includes(appearNote.visibility) &&
(!appearNote.channel || appearNote.channel.allowRenoteToExternal)
!['followers', 'specified'].includes(appearNote.visibility)
) {
// renote to public
if (appearNote.visibility === 'public' && defaultStore.state.forceRenoteVisibilitySelection === 'public') {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
misskeyApi('notes/create', {
localOnly,
visibility: 'public',
@ -983,7 +978,6 @@ export async function getRenoteOnly(props: {
// renote to home
if (['home', 'public'].includes(appearNote.visibility) && defaultStore.state.forceRenoteVisibilitySelection === 'home') {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
misskeyApi('notes/create', {
localOnly,
visibility: 'home',
@ -995,7 +989,6 @@ export async function getRenoteOnly(props: {
// renote to followers
if (defaultStore.state.forceRenoteVisibilitySelection === 'followers') {
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
misskeyApi('notes/create', {
localOnly,
visibility: 'followers',
@ -1006,3 +999,4 @@ export async function getRenoteOnly(props: {
}
}
}
}