From 59ea2645db827335a0689d2fb7aeeef4e52af52b Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Thu, 18 Sep 2025 13:56:04 +0200 Subject: new: subJsonEnable after this subEnable by default is true and subJsonEnable is false --- web/assets/js/model/setting.js | 3 ++- web/assets/js/subscription.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'web/assets') diff --git a/web/assets/js/model/setting.js b/web/assets/js/model/setting.js index 55fbf635..d3f7f3e2 100644 --- a/web/assets/js/model/setting.js +++ b/web/assets/js/model/setting.js @@ -26,7 +26,8 @@ class AllSetting { this.twoFactorEnable = false; this.twoFactorToken = ""; this.xrayTemplateConfig = ""; - this.subEnable = false; + this.subEnable = true; + this.subJsonEnable = false; this.subTitle = ""; this.subListen = ""; this.subPort = 2096; diff --git a/web/assets/js/subscription.js b/web/assets/js/subscription.js index 2c731be3..0af95890 100644 --- a/web/assets/js/subscription.js +++ b/web/assets/js/subscription.js @@ -101,7 +101,10 @@ if (sj) this.app.subJsonUrl = sj; drawQR(this.app.subUrl); try { - new QRious({ element: document.getElementById('qrcode-subjson'), value: this.app.subJsonUrl || '', size: 220 }); + const elJson = document.getElementById('qrcode-subjson'); + if (elJson && this.app.subJsonUrl) { + new QRious({ element: elJson, value: this.app.subJsonUrl, size: 220 }); + } } catch (e) { /* ignore */ } this._onResize = () => { this.viewportWidth = window.innerWidth; }; window.addEventListener('resize', this._onResize); -- cgit v1.2.3