feat(messages): add max file size for attachments

This commit is contained in:
Philipp Rothmann 2023-08-04 10:56:21 +02:00 committed by Philipp Rothmann
parent ef6d6aa368
commit bcf47ec92b
7 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,7 @@
// app/javascript/trix-editor-overrides.js
window.addEventListener("trix-file-accept", function(event) {
if (event.file.size > 1024 * 1024 * 512) {
event.preventDefault()
alert(I18n.t('js.trix_editor.file_size_alert'))
}
})