Skip to content

Commit

Permalink
chore: remind me next time
Browse files Browse the repository at this point in the history
  • Loading branch information
hstyi committed Feb 28, 2025
1 parent eba85e6 commit de27f7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/kotlin/app/termora/actions/AppUpdateAction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AppUpdateAction private constructor() : AnAction(
}

private val updaterManager get() = UpdaterManager.getInstance()
private var isRemindMeNextTime = false

init {
isEnabled = false
Expand All @@ -65,7 +66,9 @@ class AppUpdateAction private constructor() : AnAction(
initialDelay = 3.minutes.inWholeMilliseconds,
period = 5.hours.inWholeMilliseconds, daemon = true
) {
GlobalScope.launch(Dispatchers.IO) { supervisorScope { launch { checkUpdate() } } }
if (!isRemindMeNextTime) {
GlobalScope.launch(Dispatchers.IO) { supervisorScope { launch { checkUpdate() } } }
}
}
}

Expand Down Expand Up @@ -190,6 +193,7 @@ class AppUpdateAction private constructor() : AnAction(
return
} else if (option == JOptionPane.NO_OPTION) {
isEnabled = false
isRemindMeNextTime = true
} else if (option == JOptionPane.YES_OPTION) {
updateSelf(lastVersion)
}
Expand Down

0 comments on commit de27f7d

Please sign in to comment.