Replace with-block with explicit settings

This commit is contained in:
MHSanaei 2026-04-26 20:37:03 +02:00
parent 47e229e323
commit 8620344925
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A

View file

@ -1164,24 +1164,23 @@
if (!msg.success) { if (!msg.success) {
return; return;
} }
with (msg.obj) { const settings = msg.obj || {};
this.expireDiff = expireDiff * 86400000; this.expireDiff = settings.expireDiff * 86400000;
this.trafficDiff = trafficDiff * 1073741824; this.trafficDiff = settings.trafficDiff * 1073741824;
this.defaultCert = defaultCert; this.defaultCert = settings.defaultCert;
this.defaultKey = defaultKey; this.defaultKey = settings.defaultKey;
this.tgBotEnable = tgBotEnable; this.tgBotEnable = settings.tgBotEnable;
this.subSettings = { this.subSettings = {
enable: subEnable, enable: settings.subEnable,
subTitle: subTitle, subTitle: settings.subTitle,
subURI: subURI, subURI: settings.subURI,
subJsonURI: subJsonURI, subJsonURI: settings.subJsonURI,
subJsonEnable: subJsonEnable, subJsonEnable: settings.subJsonEnable,
}; };
this.pageSize = pageSize; this.pageSize = settings.pageSize;
this.remarkModel = remarkModel; this.remarkModel = settings.remarkModel;
this.datepicker = datepicker; this.datepicker = settings.datepicker;
this.ipLimitEnable = ipLimitEnable; this.ipLimitEnable = settings.ipLimitEnable;
}
}, },
setInbounds(dbInbounds) { setInbounds(dbInbounds) {
this.inbounds.splice(0); this.inbounds.splice(0);