Skip to content

Commit

Permalink
www updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratikshakhandagale committed May 29, 2024
1 parent c1073f7 commit dcfdd35
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ export class AppComponent implements OnInit {
case 'VERSION_DETECTED':
console.log(`Downloading new app version: ${evt.version.hash}`);
this.presentUpdateAlert();
// if (confirm('A new version is available. Load it?'))
// window.location.reload();
break;
case 'VERSION_READY':
console.log(`Current app version: ${evt.currentVersion.hash}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<ion-button (click)="emitEvent($event, 'search')">
<ion-icon aria-hidden="true" src="assets/icon/search.svg"></ion-icon>
</ion-button>
<!-- <ion-button (click)="navigateToQRScreen()">
<ion-button (click)="navigateToQRScreen()">
<ion-icon aria-hidden="true" src="assets/icon/qr-scan.svg"></ion-icon>
</ion-button> -->
</ion-button>
<ion-button (click)="emitEvent($event, 'profile')">
<ion-icon aria-hidden="true" src="assets/icon/language-icon.svg"></ion-icon>
</ion-button>
Expand Down
22 changes: 17 additions & 5 deletions src/app/components/qrcode-popup/qrcode-popup.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export class QrcodePopupComponent implements OnInit {
this.scanResult = null;
}

stopScan() {
this.scanActive = false;
}

async startScan() {
// Not working on iOS standalone mode!
const stream = await navigator.mediaDevices.getUserMedia({
Expand All @@ -109,6 +105,21 @@ export class QrcodePopupComponent implements OnInit {
this.videoElement.play();
requestAnimationFrame(this.scan.bind(this));
}

stopScan() {
this.scanActive = false;

const stream = this.videoElement.srcObject;
if (stream) {
const tracks = stream.getTracks();
tracks.forEach(function(track: MediaStreamTrack) {
track.stop();
console.log('Track stopped:', track.readyState);

});
this.videoElement.srcObject = null;
}
}

async scan() {
try {
Expand Down Expand Up @@ -140,9 +151,10 @@ export class QrcodePopupComponent implements OnInit {
inversionAttempts: 'dontInvert'
});

if (code) {
if (code?.data) {
this.scanActive = false;
this.scanResult = code.data;
this.stopScan();
this.showQrToast();
} else {
if (this.scanActive) {
Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
<body>
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
<script src="runtime.46b661a8f95b90e7.js" type="module"></script><script src="polyfills.8aa0ed51fddab033.js" type="module"></script><script src="scripts.f969b614b9decf68.js" defer></script><script src="main.ca8f765bf734c089.js" type="module"></script></body>
<script src="runtime.46b661a8f95b90e7.js" type="module"></script><script src="polyfills.8aa0ed51fddab033.js" type="module"></script><script src="scripts.f969b614b9decf68.js" defer></script><script src="main.992072879ccf9331.js" type="module"></script></body>

</html>
1 change: 1 addition & 0 deletions www/main.992072879ccf9331.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion www/main.ca8f765bf734c089.js

This file was deleted.

8 changes: 4 additions & 4 deletions www/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1716962787891,
"timestamp": 1716972303495,
"index": "/index.html",
"assetGroups": [
{
Expand Down Expand Up @@ -101,7 +101,7 @@
"/9977.dfb6af23e31fcb21.js",
"/common.5a427a1d3afaf6a8.js",
"/index.html",
"/main.ca8f765bf734c089.js",
"/main.992072879ccf9331.js",
"/manifest.webmanifest",
"/polyfills-core-js.c76198334f717402.js",
"/polyfills-dom.bf542500b6fca113.js",
Expand Down Expand Up @@ -821,8 +821,8 @@
"/assets/timer.svg": "57b27e5d93af2aabd1077ecd4c70bcab678f4472",
"/assets/user.svg": "2dc572771661b2ccd3ea4ae06bf768778144cbec",
"/common.5a427a1d3afaf6a8.js": "50144b721d49fd899326719c9c832fb62323e545",
"/index.html": "5b20c0e7ba91885d722173ef7dbf8c04bae7494a",
"/main.ca8f765bf734c089.js": "d97c83f59e7bdd20c353651f92bfd1ef6f112e51",
"/index.html": "d874a844c7fc207362423c5b8fdc3ac6c2602630",
"/main.992072879ccf9331.js": "b0bb35bb3c00aa804212bf6660499a7b91b00238",
"/manifest.webmanifest": "5a927f2c991153c4e1fb8dd9fd7845bbe00ba537",
"/polyfills-core-js.c76198334f717402.js": "d6e270a2944b6a95a9b97dafd25599ba825e8d7f",
"/polyfills-dom.bf542500b6fca113.js": "3fa333db66c8050f12e99d977f5098a6de8dd593",
Expand Down

0 comments on commit dcfdd35

Please sign in to comment.