[feat] allow all ext option

This commit is contained in:
kwaroran
2023-11-25 18:56:49 +09:00
parent 2c77ae1b58
commit 5753e37f15
3 changed files with 9 additions and 8 deletions

View File

@@ -112,16 +112,12 @@ function selectFileByDom(allowedExtensions:string[], multiple:'multiple'|'single
fileInput.type = 'file';
fileInput.multiple = multiple === 'multiple';
if (allowedExtensions && allowedExtensions.length) {
//check is iphone
if(checkIsIos()){
//allow all
fileInput.accept = '*/*';
}
else{
if(!(get(DataBase).allowAllExtentionFiles || checkIsIos())){
if (allowedExtensions && allowedExtensions.length) {
fileInput.accept = allowedExtensions.map(ext => `.${ext}`).join(',');
}
}
fileInput.addEventListener('change', (event) => {
if (fileInput.files.length === 0) {