mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-27 04:31:27 +08:00
fix(ProxyManager): handle optional currentProxy in system proxy check and log changes (#8865)
This commit is contained in:
parent
281c545a8f
commit
9e0aa1f3fa
@ -87,10 +87,11 @@ export class ProxyManager {
|
|||||||
// Set new interval
|
// Set new interval
|
||||||
this.systemProxyInterval = setInterval(async () => {
|
this.systemProxyInterval = setInterval(async () => {
|
||||||
const currentProxy = await getSystemProxy()
|
const currentProxy = await getSystemProxy()
|
||||||
if (currentProxy && currentProxy.proxyUrl.toLowerCase() === this.config?.proxyRules) {
|
if (currentProxy?.proxyUrl.toLowerCase() === this.config?.proxyRules) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info(`system proxy changed: ${currentProxy?.proxyUrl}, this.config.proxyRules: ${this.config.proxyRules}`)
|
||||||
await this.configureProxy({
|
await this.configureProxy({
|
||||||
mode: 'system',
|
mode: 'system',
|
||||||
proxyRules: currentProxy?.proxyUrl.toLowerCase(),
|
proxyRules: currentProxy?.proxyUrl.toLowerCase(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user