diff options
| author | ろむねこ <66072112+r-ca@users.noreply.github.com> | 2025-03-10 19:35:37 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-10 10:35:37 +0000 |
| commit | 6841cdfa76f1c18041c766247b61ba2f47f2dfec (patch) | |
| tree | 56048d762ee2d70d5463f302c123b0a57a563b8a /packages/frontend/src/components/MkPostForm.vue | |
| parent | Bump version to 2025.3.2-alpha.5 (diff) | |
| download | sharkey-6841cdfa76f1c18041c766247b61ba2f47f2dfec.tar.gz sharkey-6841cdfa76f1c18041c766247b61ba2f47f2dfec.tar.bz2 sharkey-6841cdfa76f1c18041c766247b61ba2f47f2dfec.zip | |
enhance(frontend): CWの注釈テキストが入力されていない場合はPostボタンを非アクティブに (#15639)
* add condition to disable post button when CW text is empty
* standardize condition by using 1<= inserted of 0<
* unify CW text length condition to improve readability
* add missing CW state check
* fix state check, add empty/null check, improve max length validation
* simplify CW validation by removing minimum length check
* Update CHANGELOG
* remove CW text validation in post()
---------
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/frontend/src/components/MkPostForm.vue')
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 6a72663157..5e379d08b7 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -265,7 +265,13 @@ const canPost = computed((): boolean => { quoteId.value != null ) && (textLength.value <= maxTextLength.value) && - (cwTextLength.value <= maxCwTextLength) && + ( + useCw.value ? + ( + cw.value != null && cw.value.trim() !== '' && + cwTextLength.value <= maxCwTextLength + ) : true + ) && (files.value.length <= 16) && (!poll.value || poll.value.choices.length >= 2); }); @@ -744,14 +750,6 @@ function isAnnoying(text: string): boolean { } async function post(ev?: MouseEvent) { - if (useCw.value && (cw.value == null || cw.value.trim() === '')) { - os.alert({ - type: 'error', - text: i18n.ts.cwNotationRequired, - }); - return; - } - if (ev) { const el = (ev.currentTarget ?? ev.target) as HTMLElement | null; |