mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
chore: remind me next time
This commit is contained in:
@@ -47,6 +47,7 @@ class AppUpdateAction private constructor() : AnAction(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val updaterManager get() = UpdaterManager.getInstance()
|
private val updaterManager get() = UpdaterManager.getInstance()
|
||||||
|
private var isRemindMeNextTime = false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
isEnabled = false
|
isEnabled = false
|
||||||
@@ -65,7 +66,9 @@ class AppUpdateAction private constructor() : AnAction(
|
|||||||
initialDelay = 3.minutes.inWholeMilliseconds,
|
initialDelay = 3.minutes.inWholeMilliseconds,
|
||||||
period = 5.hours.inWholeMilliseconds, daemon = true
|
period = 5.hours.inWholeMilliseconds, daemon = true
|
||||||
) {
|
) {
|
||||||
GlobalScope.launch(Dispatchers.IO) { supervisorScope { launch { checkUpdate() } } }
|
if (!isRemindMeNextTime) {
|
||||||
|
GlobalScope.launch(Dispatchers.IO) { supervisorScope { launch { checkUpdate() } } }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +193,7 @@ class AppUpdateAction private constructor() : AnAction(
|
|||||||
return
|
return
|
||||||
} else if (option == JOptionPane.NO_OPTION) {
|
} else if (option == JOptionPane.NO_OPTION) {
|
||||||
isEnabled = false
|
isEnabled = false
|
||||||
|
isRemindMeNextTime = true
|
||||||
} else if (option == JOptionPane.YES_OPTION) {
|
} else if (option == JOptionPane.YES_OPTION) {
|
||||||
updateSelf(lastVersion)
|
updateSelf(lastVersion)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user