diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-18 14:56:04 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-18 14:56:04 +0300 |
| commit | 59ea2645db827335a0689d2fb7aeeef4e52af52b (patch) | |
| tree | a52caa80571fef4919c3df59a4bceacd60ba6aa6 /web/assets/js | |
| parent | 8c8d280f147ce4e8f604080d1dbf066332e55efc (diff) | |
new: subJsonEnable
after this subEnable by default is true
and subJsonEnable is false
Diffstat (limited to 'web/assets/js')
| -rw-r--r-- | web/assets/js/model/setting.js | 3 | ||||
| -rw-r--r-- | web/assets/js/subscription.js | 5 |
2 files changed, 6 insertions, 2 deletions
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); |
