Don't warn if next loop invocation is prior to update check

This commit is contained in:
AdrianLxM 2019-04-25 22:13:31 +02:00 committed by GitHub
parent c56902d8d3
commit f2c18cbc1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,13 @@ object VersionCheckerPlugin : PluginBase(PluginDescription()
private fun checkWarning() {
val now = System.currentTimeMillis()
if (!SP.contains(R.string.key_last_versionchecker_plugin_warning)) {
SP.putLong(R.string.key_last_versionchecker_plugin_warning, now)
return
}
if (isOldVersion(GRACE_PERIOD_WARNING) && shouldWarnAgain(now)) {
// store last notification time
SP.putLong(R.string.key_last_versionchecker_plugin_warning, now)