1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2025-01-23 02:04:33 +09:00
This commit is contained in:
NoriDev 2024-10-03 12:59:12 +09:00
parent e37933ff21
commit c272e3bc3c
2 changed files with 52 additions and 10 deletions

View File

@ -553,6 +553,7 @@ async function toggleLocalOnly() {
},
],
});
if (confirm.canceled) return;
if (confirm.result === 'no') return;
@ -786,14 +787,34 @@ async function post(ev?: MouseEvent) {
}
if (defaultStore.state.showNoAltTextWarning && files.value.some((f) => f.comment == null || f.comment.length === 0)) {
const { canceled } = await os.confirm({
const confirm = await os.actions({
type: 'warning',
text: i18n.ts._altWarning.noAltWarning,
title: i18n.ts._altWarning.noAltWarning,
caption: i18n.ts._altWarning.noAltWarningDescription,
okText: i18n.ts.goBack,
cancelText: i18n.ts.thisPostMayBeAnnoyingIgnore,
actions: [
{
value: 'yes' as const,
text: i18n.ts.thisPostMayBeAnnoyingIgnore,
},
{
value: 'neverShow' as const,
text: `${i18n.ts.thisPostMayBeAnnoyingIgnore} (${i18n.ts.neverShow})`,
danger: true,
},
{
value: 'no' as const,
text: i18n.ts.goBack,
primary: true,
},
],
});
if (!canceled) return;
if (confirm.canceled) return;
if (confirm.result === 'no') return;
if (confirm.result === 'neverShow') {
defaultStore.set('showNoAltTextWarning', false);
}
}
if (ev) {

View File

@ -545,6 +545,7 @@ async function toggleLocalOnly() {
},
],
});
if (confirm.canceled) return;
if (confirm.result === 'no') return;
@ -775,14 +776,34 @@ async function post(ev?: MouseEvent) {
}
if (defaultStore.state.showNoAltTextWarning && files.value.some((f) => f.comment == null || f.comment.length === 0)) {
const { canceled } = await os.confirm({
const confirm = await os.actions({
type: 'warning',
text: i18n.ts._altWarning.noAltWarning,
title: i18n.ts._altWarning.noAltWarning,
caption: i18n.ts._altWarning.noAltWarningDescription,
okText: i18n.ts.goBack,
cancelText: i18n.ts.thisPostMayBeAnnoyingIgnore,
actions: [
{
value: 'yes' as const,
text: i18n.ts.thisPostMayBeAnnoyingIgnore,
},
{
value: 'neverShow' as const,
text: `${i18n.ts.thisPostMayBeAnnoyingIgnore} (${i18n.ts.neverShow})`,
danger: true,
},
{
value: 'no' as const,
text: i18n.ts.goBack,
primary: true,
},
],
});
if (!canceled) return;
if (confirm.canceled) return;
if (confirm.result === 'no') return;
if (confirm.result === 'neverShow') {
defaultStore.set('showNoAltTextWarning', false);
}
}
if (ev) {