fix: 移除不必要的促销相关代码和更新 UI 逻辑
This commit is contained in:
@@ -1252,35 +1252,6 @@ function setIpProxyEnabledInlineStatus(state = {}, enabled = getSelectedIpProxyE
|
||||
}
|
||||
}
|
||||
|
||||
function updateIpProxyPromoOverflow() {
|
||||
if (
|
||||
typeof ipProxyPromo === 'undefined'
|
||||
|| typeof ipProxyPromoText === 'undefined'
|
||||
|| !ipProxyPromo
|
||||
|| !ipProxyPromoText
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (!ipProxyPromo.getClientRects().length) {
|
||||
ipProxyPromo.classList.remove('is-overflowing');
|
||||
return;
|
||||
}
|
||||
const overflowing = ipProxyPromoText.scrollWidth > Math.max(0, ipProxyPromo.clientWidth - 2);
|
||||
ipProxyPromo.classList.toggle('is-overflowing', overflowing);
|
||||
}
|
||||
|
||||
function scheduleIpProxyPromoOverflowCheck() {
|
||||
if (typeof globalThis.requestAnimationFrame === 'function') {
|
||||
globalThis.requestAnimationFrame(updateIpProxyPromoOverflow);
|
||||
return;
|
||||
}
|
||||
globalThis.setTimeout(updateIpProxyPromoOverflow, 0);
|
||||
}
|
||||
|
||||
if (typeof globalThis.addEventListener === 'function') {
|
||||
globalThis.addEventListener('resize', scheduleIpProxyPromoOverflowCheck);
|
||||
}
|
||||
|
||||
function updateIpProxyUI(state = latestState) {
|
||||
const enabled = getSelectedIpProxyEnabled();
|
||||
const showSettings = enabled && ipProxySectionExpanded;
|
||||
@@ -1312,9 +1283,6 @@ function updateIpProxyUI(state = latestState) {
|
||||
if (rowIpProxyFold) {
|
||||
rowIpProxyFold.style.display = showSettings ? '' : 'none';
|
||||
}
|
||||
if (rowIpProxyPromo) {
|
||||
rowIpProxyPromo.style.display = showSettings ? '' : 'none';
|
||||
}
|
||||
if (rowIpProxyService) {
|
||||
rowIpProxyService.style.display = showSettings ? '' : 'none';
|
||||
}
|
||||
@@ -1377,7 +1345,6 @@ function updateIpProxyUI(state = latestState) {
|
||||
if (ipProxyLayout) {
|
||||
ipProxyLayout.classList.toggle('is-account-only', !apiModeAvailable);
|
||||
}
|
||||
scheduleIpProxyPromoOverflowCheck();
|
||||
if (selectIpProxyService) {
|
||||
selectIpProxyService.value = service;
|
||||
selectIpProxyService.disabled = true;
|
||||
|
||||
Reference in New Issue
Block a user