This commit is contained in:
iqudoo
2026-04-30 19:35:24 +08:00
parent ef3034014b
commit 3856b6e8c9
2 changed files with 8 additions and 3 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -383,8 +383,13 @@ function detectImageFile(detector, file) {
}
export function startScanForImage() {
return createBarcodeDetector(getConfig("webScanType")).then(detector => {
return chooseImageFile().then(file => detectImageFile(detector, file));
return chooseImageFile().then(file => {
if (!file) {
return null;
}
return createBarcodeDetector(getConfig("webScanType")).then(detector => {
return detectImageFile(detector, file);
});
}).then(code => {
if (code && code.rawValue) {
return {