Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
didInsertElement: function() {
const text = this.get('text');
const elementId = this.get('elementId');
const correctLevel = this.get('correctLevel');
const colorLight = this.get('colorLight');
const colorDark = this.get('colorDark');
const width = this.get('width');
const height = this.get('height');
let qrcode = new QRCode(elementId, {
text,
width,
height,
colorDark,
colorLight,
correctLevel: QRCode.CorrectLevel[correctLevel],
});
this.set('qrcode', qrcode);
},
renderPairing({ pairingToken }) {
const token = pairingToken;
if (token) {
if (!this.qr) {
this.qr = new QRCode($('#qrcode')[0], {
text: token,
width: 256,
height: 256,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.Q,
});
$('<div class="icon-logo"></div>').insertAfter('#qrcode > canvas');
} else {
this.qr.makeCode(token);
}
}
}