mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 11:25:13 +00:00
updated to use .some
This commit is contained in:
parent
0c28bfdb63
commit
3c4f3cb81d
1 changed files with 17 additions and 19 deletions
|
@ -747,26 +747,24 @@ async function post(ev?: MouseEvent) {
|
|||
|
||||
if (defaultStore.state.warnMissingAltText) {
|
||||
const filesData = toRaw(files.value);
|
||||
for (let i = 0; i < filesData.length; i++) {
|
||||
const file = filesData[i];
|
||||
const isMissingAltText = !file.comment;
|
||||
if (isMissingAltText) {
|
||||
const { canceled, result } = await os.actions({
|
||||
type: 'warning',
|
||||
text: i18n.ts.thisPostIsMissingAltText,
|
||||
actions: [{
|
||||
value: 'cancel',
|
||||
text: i18n.ts.thisPostIsMissingAltTextCancel,
|
||||
}, {
|
||||
value: 'ignore',
|
||||
text: i18n.ts.thisPostIsMissingAltTextIgnore,
|
||||
}],
|
||||
});
|
||||
|
||||
if (canceled) return;
|
||||
if (result === 'cancel') return;
|
||||
break;
|
||||
}
|
||||
const isMissingAltText = filesData.some(file => !file.comment);
|
||||
|
||||
if (isMissingAltText) {
|
||||
const { canceled, result } = await os.actions({
|
||||
type: 'warning',
|
||||
text: i18n.ts.thisPostIsMissingAltText,
|
||||
actions: [{
|
||||
value: 'cancel',
|
||||
text: i18n.ts.thisPostIsMissingAltTextCancel,
|
||||
}, {
|
||||
value: 'ignore',
|
||||
text: i18n.ts.thisPostIsMissingAltTextIgnore,
|
||||
}],
|
||||
});
|
||||
|
||||
if (canceled) return;
|
||||
if (result === 'cancel') return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue