mirror of
https://github.com/InvertGeek/MixFile.git
synced 2026-06-08 15:32:46 +08:00
修复文件可以重复导入的问题
This commit is contained in:
@@ -14,8 +14,8 @@ android {
|
||||
applicationId = "com.donut.mixfile"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 32
|
||||
versionName = "1.4.1"
|
||||
versionCode = 33
|
||||
versionName = "1.4.2"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
||||
@@ -346,7 +346,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
||||
color: blueviolet;
|
||||
box-shadow: 0 0 13px 3px blueviolet;
|
||||
}
|
||||
`,Qc=new lS(2);async function uS(e,t){const n=new AbortController,r=`${Yo}api/upload?name=${encodeURIComponent(e.name)}`;t({tip:"等待中",progress:0,title:e.name,cancel(){n.abort()}}),await Qc.acquire(),console.log("await"),t({tip:`上传中: 0/${yo(e.size)}`,progress:0,title:e.name,cancel(){n.abort()}});try{await Be.put(r,e,{onUploadProgress:o=>{const{loaded:i,total:s}=o;t({tip:`上传中: ${yo(i,!0)}/${yo(s)}`,progress:i/s*100,title:e.name,cancel(){n.abort(),ra("上传已取消")}})},signal:n.signal})}catch(o){t({error:!0,tip:"上传失败",progress:0,title:e.name}),o.message;return}finally{Qc.release()}t({tip:"上传完成",progress:100,title:e.name})}function dS(e){return $(cS,{children:[$("input",{type:"file",id:"select-file",hidden:!0,onChange:t=>{Jc(t.target.files),t.target.value=""},multiple:"multiple"}),$(eS,{onTargetClick:()=>{document.querySelector("#select-file").click()},onDrop:(t,n)=>{Jc(t)},children:"选择/拖入文件"})]})}const fS=cn.div`
|
||||
`,Qc=new lS(2);async function uS(e,t){const n=new AbortController,r=`${Yo}api/upload?name=${encodeURIComponent(e.name)}`;t({tip:"等待中",progress:0,title:e.name,cancel(){n.abort()}}),await Qc.acquire(),t({tip:`上传中: 0/${yo(e.size)}`,progress:0,title:e.name,cancel(){n.abort()}});try{await Be.put(r,e,{onUploadProgress:o=>{const{loaded:i,total:s}=o;t({tip:`上传中: ${yo(i,!0)}/${yo(s)}`,progress:i/s*100,title:e.name,cancel(){n.abort(),ra("上传已取消")}})},signal:n.signal})}catch(o){t({error:!0,tip:"上传失败",progress:0,title:e.name}),o.message;return}finally{Qc.release()}t({tip:"上传完成",progress:100,title:e.name})}function dS(e){return $(cS,{children:[$("input",{type:"file",id:"select-file",hidden:!0,onChange:t=>{Jc(t.target.files),t.target.value=""},multiple:"multiple"}),$(eS,{onTargetClick:()=>{document.querySelector("#select-file").click()},onDrop:(t,n)=>{Jc(t)},children:"选择/拖入文件"})]})}const fS=cn.div`
|
||||
margin: 5vh auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1" name="viewport"/>
|
||||
<title>MixFile</title>
|
||||
<script type="module" crossorigin src="/assets/index-zUG0paJ1.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-Dtblmhnv.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BuZ9x1Ok.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -50,6 +50,7 @@ fun showFileList(fileList: List<FileDataLog>) {
|
||||
favCategories += it.category
|
||||
}
|
||||
favorites += fileList
|
||||
favorites = favorites.distinct()
|
||||
showToast("导入了 ${favorites.size - prevSize} 个文件")
|
||||
closeDialog()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user