diff options
| author | KevinWh0 <45321184+KevinWh0@users.noreply.github.com> | 2024-02-19 20:53:13 +0100 |
|---|---|---|
| committer | KevinWh0 <45321184+KevinWh0@users.noreply.github.com> | 2024-02-19 20:53:13 +0100 |
| commit | 3c4f3cb81d1b3181b137cbafd4a90db9fa43b626 (patch) | |
| tree | db637c0aedbc764f5ecea82c4032093687692373 | |
| parent | Added Japanese Translations (diff) | |
| download | sharkey-3c4f3cb81d1b3181b137cbafd4a90db9fa43b626.tar.gz sharkey-3c4f3cb81d1b3181b137cbafd4a90db9fa43b626.tar.bz2 sharkey-3c4f3cb81d1b3181b137cbafd4a90db9fa43b626.zip | |
updated to use .some
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index ba27b2b469..12f469b35c 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -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; } } |