Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit 059f1fc

Browse files
author
icymind
committed
disable currentGateway detection on windows
1 parent 908196f commit 059f1fc

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/main/index.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,19 @@ app.on('ready', () => {
263263
contextMenu.items[1].checked = !arg
264264
})
265265

266-
;(async function () {
267-
const {cfg} = await VRouter.getLatestCfg()
268-
setInterval(async () => {
269-
const currentGWIP = await Utils.getCurrentGateway()
270-
const currentDnsIP = await Utils.getCurrentDns()
271-
if (currentGWIP !== currentDnsIP && [currentGWIP, currentDnsIP].includes(cfg.openwrt.ip)) {
272-
logger.info(`currentGWIP/currentDnsIP not match, correct them to ${cfg.openwrt.ip}`)
273-
await VRouter.toggleRouting(true, 'on').catch(console.warn)
274-
} else {
275-
// change menubar icon
276-
}
277-
}, 120000)
278-
})()
266+
if (os.platform() === 'darwin') {
267+
;(async function () {
268+
const {cfg} = await VRouter.getLatestCfg()
269+
setInterval(async () => {
270+
const currentGWIP = await Utils.getCurrentGateway()
271+
const currentDnsIP = await Utils.getCurrentDns()
272+
if (currentGWIP !== currentDnsIP && [currentGWIP, currentDnsIP].includes(cfg.openwrt.ip)) {
273+
logger.info(`currentGWIP/currentDnsIP not match, correct them to ${cfg.openwrt.ip}`)
274+
await VRouter.toggleRouting(true, 'on').catch(console.warn)
275+
} else {
276+
// change menubar icon
277+
}
278+
}, 120000)
279+
})()
280+
}
279281
})

0 commit comments

Comments
 (0)