Skip to content

Commit adb6126

Browse files
committed
do redirect after scan
1 parent ff8bd42 commit adb6126

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

OpenFlow/src/public/Controllers.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,24 +535,28 @@ module openflow {
535535
console.error(error);
536536
}
537537
}
538-
async QRScannerHit(err, contents) {
538+
async QRScannerHit(err, value) {
539539
try {
540540
console.log("QRScannerHit");
541541
if (err) {
542542
// console.error(err._message);
543543
console.error(err);
544544
return;
545545
}
546-
console.log(contents);
546+
console.log(value);
547547
QRScanner.hide();
548548
QRScanner.destroy();
549549

550-
console.log("set mobiledomain to " + contents);
551-
await this.writefile("mobiledomain.txt", contents);
552-
window.location.replace("https://" + contents);
550+
console.log("set mobiledomain to " + value);
551+
await this.writefile("mobiledomain.txt", value);
553552

554553
this.scanning = false;
555554
if (!this.$scope.$$phase) { this.$scope.$apply(); }
555+
if (value !== null && value !== undefined && value !== "") {
556+
console.log(value);
557+
var config = JSON.parse(value);
558+
window.location.replace(config.url);
559+
}
556560
} catch (error) {
557561
console.error("Error QRScannerHit");
558562
console.error(error);

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.152
1+
0.0.153

0 commit comments

Comments
 (0)