Skip to content

Commit

Permalink
fix(frontend): ファイルの添付可能数を超えたらノートボタンを押せないように (#15126)
Browse files Browse the repository at this point in the history
* fix(frontend): ファイルの添付可能数を超えたらノートボタンを押せないように

* Update Changelog

* Update MkPostForm.vue
  • Loading branch information
kakkokari-gtyih authored Jan 4, 2025
1 parent 256560e commit 1fbc129
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Fix: `Ui:C:select`で値の変更が画面に反映されない問題を修正
- Fix: MiAuth認可画面で、認可処理に失敗した場合でもコールバックURLに遷移してしまう問題を修正
(Cherry-picked from https://github.com/TeamNijimiss/misskey/commit/800359623e41a662551d774de15b0437b6849bb4)
- Fix: ノート作成画面でファイルの添付可能個数を超えてもノートボタンが押せていた問題を修正

### Server
- Fix: ユーザーのプロフィール画面をアドレス入力などで直接表示した際に概要タブの描画に失敗する問題の修正( #15032 )
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const canPost = computed((): boolean => {
quoteId.value != null
) &&
(textLength.value <= maxTextLength.value) &&
(files.value.length <= 16) &&
(!poll.value || poll.value.choices.length >= 2);
});

Expand Down
8 changes: 7 additions & 1 deletion packages/frontend/src/components/MkPostFormAttaches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</template>
</Sortable>
<p :class="$style.remain">{{ 16 - props.modelValue.length }}/16</p>
<p :class="[$style.remain, {
[$style.exceeded]: props.modelValue.length > 16,
}]">{{ 16 - props.modelValue.length }}/16</p>
</div>
</template>

Expand Down Expand Up @@ -239,5 +241,9 @@ function showFileMenu(file: Misskey.entities.DriveFile, ev: MouseEvent | Keyboar
margin: 0;
padding: 0;
font-size: 90%;

&.exceeded {
color: var(--MI_THEME-error);
}
}
</style>

0 comments on commit 1fbc129

Please sign in to comment.