From 08eaf7052fb17e94ea8d35dc4f0b6c27a2cbdc94 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 7 Sep 2023 11:47:06 +0300 Subject: [PATCH] reduce file char limit on mobile chat --- files/assets/js/chat.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/assets/js/chat.js b/files/assets/js/chat.js index e8d4b7e1e..c149369b8 100644 --- a/files/assets/js/chat.js +++ b/files/assets/js/chat.js @@ -353,7 +353,8 @@ document.addEventListener('click', function (e) { const input = document.getElementById('file') function handle_files() { if (!input.files.length) return - input.previousElementSibling.textContent = input.files[0].name.substr(0, 50); + const char_limit = screen_width >= 768 ? 50 : 5; + input.previousElementSibling.textContent = input.files[0].name.substr(0, char_limit); } input.onchange = handle_files