Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87d9fa5

Browse files
committed
Only add options if they exist.
1 parent 12d1fa1 commit 87d9fa5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

resources/ext/js/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,9 @@ function buildBarcodeURL() {
341341
// The API target
342342
var url = //
343343
location.origin + //
344-
"/api" + //
345-
"/" + type + //
346-
"/" + encodeURIComponent(text) + //
347-
"?" + buildOptionsString();
344+
"/api/" + type + "/" + //
345+
encodeURIComponent(text) + //
346+
buildOptionsString();
348347

349348
return url;
350349
}
@@ -457,7 +456,7 @@ function delayUpdateBarcode() {
457456
*/
458457
function buildOptionsString() {
459458

460-
var options = "";
459+
var options = "?";
461460

462461
// Override Color (FG)
463462
if (appOptions.render.colorFG != appOptions.default.colorFG) {
@@ -484,7 +483,7 @@ function buildOptionsString() {
484483
options += "&text=" + appOptions.render.hrt;
485484
}
486485

487-
return options;
486+
return (options.length > 1) ? options : "";
488487
}
489488

490489
/**

0 commit comments

Comments
 (0)