mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-27 14:28:53 +09:00
refactor
This commit is contained in:
parent
f70275b42f
commit
40d6a58939
@ -818,21 +818,20 @@ export function getRenoteMenu(props: {
|
|||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// Add visibility section
|
// Add visibility section
|
||||||
if (
|
if (
|
||||||
defaultStore.state.renoteVisibilitySelection &&
|
defaultStore.state.renoteVisibilitySelection &&
|
||||||
!['followers', 'specified'].includes(appearNote.visibility) &&
|
!['followers', 'specified'].includes(appearNote.visibility)
|
||||||
(!appearNote.channel || appearNote.channel.allowRenoteToExternal)
|
|
||||||
) {
|
) {
|
||||||
|
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
||||||
|
|
||||||
// renote to public
|
// renote to public
|
||||||
if (appearNote.visibility === 'public') {
|
if (appearNote.visibility === 'public') {
|
||||||
visibilityRenoteItems.push({
|
visibilityRenoteItems.push({
|
||||||
text: `${i18n.ts.renote} (${i18n.ts._visibility.public})`,
|
text: `${i18n.ts.renote} (${i18n.ts._visibility.public})`,
|
||||||
icon: 'ti ti-world',
|
icon: 'ti ti-world',
|
||||||
action: () => {
|
action: () => {
|
||||||
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
|
||||||
misskeyApi('notes/create', {
|
misskeyApi('notes/create', {
|
||||||
localOnly,
|
localOnly,
|
||||||
visibility: 'public',
|
visibility: 'public',
|
||||||
@ -850,7 +849,6 @@ export function getRenoteMenu(props: {
|
|||||||
text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`,
|
text: `${i18n.ts.renote} (${i18n.ts._visibility.home})`,
|
||||||
icon: 'ti ti-home',
|
icon: 'ti ti-home',
|
||||||
action: () => {
|
action: () => {
|
||||||
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
|
||||||
misskeyApi('notes/create', {
|
misskeyApi('notes/create', {
|
||||||
localOnly,
|
localOnly,
|
||||||
visibility: 'home',
|
visibility: 'home',
|
||||||
@ -867,7 +865,6 @@ export function getRenoteMenu(props: {
|
|||||||
text: `${i18n.ts.renote} (${i18n.ts._visibility.followers})`,
|
text: `${i18n.ts.renote} (${i18n.ts._visibility.followers})`,
|
||||||
icon: 'ti ti-lock',
|
icon: 'ti ti-lock',
|
||||||
action: () => {
|
action: () => {
|
||||||
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
|
||||||
misskeyApi('notes/create', {
|
misskeyApi('notes/create', {
|
||||||
localOnly,
|
localOnly,
|
||||||
visibility: 'followers',
|
visibility: 'followers',
|
||||||
@ -878,6 +875,7 @@ export function getRenoteMenu(props: {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const renoteItems = addDividersBetweenMenuSections(
|
const renoteItems = addDividersBetweenMenuSections(
|
||||||
normalRenoteItems,
|
normalRenoteItems,
|
||||||
@ -960,18 +958,15 @@ export async function getRenoteOnly(props: {
|
|||||||
os.toast(i18n.ts.renoted, 'renote');
|
os.toast(i18n.ts.renoted, 'renote');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Add visibility section
|
// Add visibility section
|
||||||
if (
|
if (
|
||||||
!defaultStore.state.renoteVisibilitySelection &&
|
!defaultStore.state.renoteVisibilitySelection &&
|
||||||
defaultStore.state.forceRenoteVisibilitySelection !== 'none' &&
|
defaultStore.state.forceRenoteVisibilitySelection !== 'none' &&
|
||||||
!['followers', 'specified'].includes(appearNote.visibility) &&
|
!['followers', 'specified'].includes(appearNote.visibility)
|
||||||
(!appearNote.channel || appearNote.channel.allowRenoteToExternal)
|
|
||||||
) {
|
) {
|
||||||
// renote to public
|
// renote to public
|
||||||
if (appearNote.visibility === 'public' && defaultStore.state.forceRenoteVisibilitySelection === 'public') {
|
if (appearNote.visibility === 'public' && defaultStore.state.forceRenoteVisibilitySelection === 'public') {
|
||||||
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
|
||||||
misskeyApi('notes/create', {
|
misskeyApi('notes/create', {
|
||||||
localOnly,
|
localOnly,
|
||||||
visibility: 'public',
|
visibility: 'public',
|
||||||
@ -983,7 +978,6 @@ export async function getRenoteOnly(props: {
|
|||||||
|
|
||||||
// renote to home
|
// renote to home
|
||||||
if (['home', 'public'].includes(appearNote.visibility) && defaultStore.state.forceRenoteVisibilitySelection === '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', {
|
misskeyApi('notes/create', {
|
||||||
localOnly,
|
localOnly,
|
||||||
visibility: 'home',
|
visibility: 'home',
|
||||||
@ -995,7 +989,6 @@ export async function getRenoteOnly(props: {
|
|||||||
|
|
||||||
// renote to followers
|
// renote to followers
|
||||||
if (defaultStore.state.forceRenoteVisibilitySelection === 'followers') {
|
if (defaultStore.state.forceRenoteVisibilitySelection === 'followers') {
|
||||||
const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
|
||||||
misskeyApi('notes/create', {
|
misskeyApi('notes/create', {
|
||||||
localOnly,
|
localOnly,
|
||||||
visibility: 'followers',
|
visibility: 'followers',
|
||||||
@ -1006,3 +999,4 @@ export async function getRenoteOnly(props: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user