Improve proxy initialization with last used proxy restoration

This commit is contained in:
go0p
2026-08-06 15:11:35 +08:00
committed by go0p
parent 1a901424ae
commit 362349e75a
3 changed files with 16 additions and 8 deletions
+1
View File
@@ -105,6 +105,7 @@ async function switchProxy(config) {
};
}
// 发送配置更改消息
await sendMessageWithRetry({
action: ProxyActionType.SET_PROXY_CONFIG,
config: proxyConfig
+2 -2
View File
@@ -43,9 +43,9 @@ export class ProxySettings {
]);
}
// 确保日志存储已初始化
const logs = await proxyStore.getLogs(); // 使用 getLogs 而不是 getProxyLogs
const logs = await proxyStore.getLogs();
if (!logs || logs.length === 0) {
await proxyStore.clearLogs(); // 初始化日志存储
await proxyStore.clearLogs();
}
}
}