Skip to content

Commit 4d44455

Browse files
committed
chore: add check for update with interval
1 parent 4ee1970 commit 4d44455

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/main/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { debounce } from 'lodash'
88
import { subscribeToChannels } from './services/ipc'
99
import { mainMenu } from './menu/main'
1010
import { subscribeToDialog } from './services/ipc/dialog'
11-
import { checkForUpdate } from './services/update-check'
11+
import { checkForUpdateWithInterval } from './services/update-check'
1212

1313
const isDev = process.env.NODE_ENV === 'development'
1414
const isMac = process.platform === 'darwin'
@@ -46,7 +46,7 @@ function createWindow () {
4646
mainWindow.on('resize', () => storeBounds(mainWindow))
4747
mainWindow.on('move', () => storeBounds(mainWindow))
4848

49-
checkForUpdate()
49+
checkForUpdateWithInterval()
5050
}
5151

5252
const storeBounds = debounce((mainWindow: BrowserWindow) => {

src/main/services/update-check.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ export const checkForUpdate = async () => {
2626
console.error(err)
2727
}
2828
}
29+
30+
export const checkForUpdateWithInterval = () => {
31+
checkForUpdate()
32+
33+
setInterval(() => {
34+
checkForUpdate()
35+
}, 1000 * 60 * 360) // 6 часов
36+
}

0 commit comments

Comments
 (0)