mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
If the user decides to remain in the system even if the server is not reachable, the dialog will not appear for a fixed period of time
This commit is contained in:
parent
301142b2c6
commit
281e1ba3ee
4 changed files with 29 additions and 11 deletions
|
|
@ -23,6 +23,7 @@ object Preferences {
|
|||
private const val AUDIO_TRANSCODE_FORMAT_MOBILE = "audio_transcode_format_mobile"
|
||||
private const val WIFI_ONLY = "wifi_only"
|
||||
private const val DATA_SAVING_MODE = "data_saving_mode"
|
||||
private const val SERVER_UNREACHABLE = "server_unreachable"
|
||||
private const val SYNC_STARRED_TRACKS_FOR_OFFLINE_USE = "sync_starred_tracks_for_offline_use"
|
||||
|
||||
@JvmStatic
|
||||
|
|
@ -186,4 +187,15 @@ object Preferences {
|
|||
SYNC_STARRED_TRACKS_FOR_OFFLINE_USE, isStarredSyncEnabled
|
||||
).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showServerUnreachableDialog(): Boolean {
|
||||
return App.getInstance().preferences.getLong(SERVER_UNREACHABLE, 0) + 360000 < System.currentTimeMillis()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setServerUnreachableDatetime(datetime: Long) {
|
||||
App.getInstance().preferences.edit()
|
||||
.putLong(SERVER_UNREACHABLE, datetime).apply()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue