Skip to content

Commit 4f26a37

Browse files
authored
Refactor updater import to use dynamic import
1 parent 1052d09 commit 4f26a37

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ async function runUpdater() {
2828
}
2929

3030
try {
31-
const checkUpdate = require('./lib/checkupdate')
31+
const updaterPath = new URL('./lib/checkupdate.js', import.meta.url)
32+
const { default: checkUpdate } = await import(updaterPath)
3233
await checkUpdate()
3334
} catch (e) {
3435
originalLog('[SYSTEM] Gagal menjalankan updater:', e.message)
@@ -130,4 +131,5 @@ function start(file) {
130131
}
131132

132133
await runUpdater()
134+
await new Promise(resolve => setTimeout(resolve, 7000))
133135
start('main.js')

0 commit comments

Comments
 (0)