Skip to content

Commit

Permalink
Refresh ip interval
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaobrien authored Jan 23, 2022
1 parent 6ce24f2 commit 9cfec35
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,27 @@ app.on('activate', function () {
}
})

var lastIps = getIPs()
setInterval(function() {
// I did some research, this is the best way to do this
var ips = getIPs()
var newIp = false
if (lastIps.length !== ips.length) {
newIp = true
}
if (newIp === false) {
for (var i=0; i<ips.length; i++) {
if (! lastIps.includes(ips[i])) {
newIp = true
break
}
}
}
if (newIp === true) {
//variable ips contains new ips
}
}, 20000) //every 20 seconds

function createWindow() {

mainWindow = new BrowserWindow({
Expand Down

0 comments on commit 9cfec35

Please sign in to comment.