Skip to content

Commit

Permalink
Merge branch 'testnet' into desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Apr 30, 2019
2 parents 7aa4ac7 + 5b1a568 commit edaa41e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/common/FieldQr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
props: {
value: {
type: String,
type: [String, Number],
required: true,
},
$value: {
Expand Down
20 changes: 8 additions & 12 deletions components/common/QrScan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
QrScanner.WORKER_PATH = QrScannerWorkerPath;
/** @type QrScanner */
let qrScanner;
export default {
components: {
Expand All @@ -20,7 +18,8 @@
},
data() {
return {
hasCamera: false,
/** @type QrScanner */
qrScanner: null,
cameraError: false,
isModalVisible: false,
isPlaying: false,
Expand All @@ -29,30 +28,27 @@
mounted() {
QrScanner.hasCamera()
.then(() => {
this.hasCamera = true;
this.$emit('update:qrVisible', true);
qrScanner = new QrScanner(this.$refs.qrVideo, (result) => {
this.qrScanner = new QrScanner(this.$refs.qrVideo, (result) => {
this.stopScanQr();
this.isModalVisible = false;
this.$emit('qrScanned', result);
});
})
.catch(() => {
this.hasCamera = false;
this.$emit('update:qrVisible', false);
});
},
destroyed() {
if (qrScanner) {
qrScanner.destroy();
if (this.qrScanner) {
this.qrScanner.destroy();
}
},
methods: {
scanQr() {
this.isModalVisible = true;
this.$refs.qrVideo.addEventListener('canplay', this.handlePlayStart);
qrScanner.start()
this.qrScanner.start()
.then(() => {
this.cameraError = false;
})
Expand All @@ -61,7 +57,7 @@
});
},
stopScanQr() {
qrScanner.stop();
this.qrScanner.stop();
this.isPlaying = false;
window.removeEventListener('resize', this.repositionOverlay);
},
Expand Down Expand Up @@ -95,7 +91,7 @@
</script>

<template>
<div v-show="hasCamera" @click.prevent>
<div v-show="qrScanner" @click.prevent>
<button class="form-field__icon form-field__icon--qr u-semantic-button" type="button" @click.prevent="scanQr">
<img src="/img/icon-qr.svg" alt="Scan QR Code" width="24" height="24">
</button>
Expand Down
3 changes: 3 additions & 0 deletions pages/wallet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
mounted() {
balanceInterval = setInterval(() => {
this.$store.dispatch('FETCH_BALANCE');
if (this.$store.getters.isOfflineMode) {
return;
}
getAddressLatestTransactionList(this.address)
.then((txListInfo) => {
this.txList = txListInfo.data;
Expand Down

0 comments on commit edaa41e

Please sign in to comment.