Skip to content

Commit dac73ed

Browse files
committed
Warn when version is incremented
1 parent cb6feb1 commit dac73ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

angular-qrcode.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ angular.module('monospaced.qrcode', [])
8282
try {
8383
qr.make();
8484
} catch (e) {
85+
var newVersion;
8586
if (version >= 40) {
8687
throw new Error('Data is too long', e);
8788
}
88-
setVersion(version + 1);
89+
newVersion = version + 1;
90+
setVersion(newVersion);
91+
console.warn('qrcode version is too low and has been incremented to', newVersion)
8992
setData(value);
9093
return;
9194
}

0 commit comments

Comments
 (0)