reduce file char limit on mobile chat

pull/200/head
Aevann 2023-09-07 11:47:06 +03:00
parent 51c46292f5
commit 08eaf7052f
1 changed files with 2 additions and 1 deletions

View File

@ -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