Skip to content

Commit 4d72bf1

Browse files
committed
alert when no barcode
1 parent 5c3c312 commit 4d72bf1

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

1.hello-world/3.read-video-angular/src/app/img-decode/img-decode.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class ImgDecodeComponent implements OnInit {
1818
for (const result of results) {
1919
alert(result.barcodeText);
2020
}
21+
if(!results.length){ alert('No barcode found'); }
2122
} catch (ex) {
2223
console.error(ex);
2324
}

1.hello-world/4.read-video-react/src/components/ImgDecode/ImgDecode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default class ImgDecode extends Component {
1515
for(let result of results){
1616
alert(result.barcodeText);
1717
}
18+
if(!results.length){ alert('No barcode found'); }
1819
} catch(ex) {
1920
console.error(ex);
2021
}

1.hello-world/5.read-video-vue/src/components/ImgDecode.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default {
1919
for(let result of results){
2020
alert(result.barcodeText);
2121
}
22+
if(!results.length){ alert('No barcode found'); }
2223
} catch(ex) {
2324
console.error(ex);
2425
}

1.hello-world/6.read-video-vue3/src/components/ImgDecode.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default {
1717
for(let result of results){
1818
alert(result.barcodeText);
1919
}
20+
if(!results.length){ alert('No barcode found'); }
2021
} catch(ex) {
2122
console.error(ex);
2223
}

1.hello-world/7.read-video-nextjs/components/ImgDecode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default class ImgDecode extends Component {
1414
for(let result of results){
1515
alert(result.barcodeText);
1616
}
17+
if(!results.length){ alert('No barcode found'); }
1718
} catch(ex) {
1819
console.error(ex);
1920
}

1.hello-world/8.read-video-nuxtjs/components/ImgDecode.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default {
2020
for(let result of results){
2121
alert(result.barcodeText);
2222
}
23+
if(!results.length){ alert('No barcode found'); }
2324
} catch(ex) {
2425
console.error(ex);
2526
}

0 commit comments

Comments
 (0)