Skip to content

Commit 7e351bd

Browse files
authored
refactor(Upload): remove async keyword (#6644)
* refactor: 精简代码 * refactor: 移除 async 关键字
1 parent eb8cbcb commit 7e351bd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/BootstrapBlazor/wwwroot/modules/upload.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Data from "./data.js"
22
import EventHandler from "./event-handler.js"
3-
import { readFileAsync } from "./utility.js"
43

54
export function init(id) {
65
const el = document.getElementById(id)
@@ -91,17 +90,14 @@ export function preview(previewerId, index) {
9190
}
9291
}
9392

94-
export async function getPreviewUrl(id, fileName) {
93+
export function getPreviewUrl(id, fileName) {
9594
let url = '';
9695
const upload = Data.get(id);
9796
const { files } = upload;
9897
if (files) {
9998
const file = [...files].find(v => v.name === fileName);
10099
if (file) {
101-
const data = await readFileAsync(file);
102-
if (data) {
103-
url = URL.createObjectURL(data);
104-
}
100+
url = URL.createObjectURL(file);
105101
}
106102
}
107103
return url;

0 commit comments

Comments
 (0)