[feat] allow all ext option
This commit is contained in:
@@ -507,6 +507,8 @@ export interface Database{
|
||||
reverseProxyOobaArgs: OobaChatCompletionRequestParams
|
||||
tpo?:boolean
|
||||
automark?:boolean
|
||||
|
||||
allowAllExtentionFiles?:boolean
|
||||
}
|
||||
|
||||
export interface customscript{
|
||||
@@ -603,7 +605,6 @@ export interface character{
|
||||
extentions?:{[key:string]:any}
|
||||
largePortrait?:boolean
|
||||
lorePlus?:boolean
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user