Fix retry and avoid remove old victory games
This commit is contained in:
parent
19b91aa432
commit
1c73756797
2 changed files with 3 additions and 13 deletions
|
@ -51,20 +51,10 @@ class HistoryAdapter(
|
|||
|
||||
if (status != SaveStatus.VICTORY) {
|
||||
holder.replay.setImageResource(R.drawable.replay)
|
||||
holder.replay.setOnClickListener {
|
||||
val intent = Intent(Intent.ACTION_VIEW).apply {
|
||||
flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
data = Uri.Builder()
|
||||
.scheme(DeepLink.SCHEME)
|
||||
.authority(DeepLink.RETRY_HOST_AUTHORITY)
|
||||
.appendPath(uid.toString())
|
||||
.build()
|
||||
}
|
||||
it.context.startActivity(intent)
|
||||
}
|
||||
holder.replay.setOnClickListener { replayGame(it, uid) }
|
||||
} else {
|
||||
holder.replay.setImageResource(R.drawable.play)
|
||||
holder.replay.setOnClickListener { replayGame(it, uid) }
|
||||
holder.replay.setOnClickListener { loadGame(it, uid) }
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener { loadGame(it, uid) }
|
||||
|
|
|
@ -30,6 +30,6 @@ interface SaveDao {
|
|||
@Delete
|
||||
suspend fun delete(save: Save)
|
||||
|
||||
@Query("DELETE FROM save WHERE uid NOT IN (SELECT uid FROM save LIMIT :maxStorage)")
|
||||
@Query("DELETE FROM save WHERE uid NOT IN (SELECT uid FROM save WHERE status != 1 LIMIT :maxStorage)")
|
||||
suspend fun deleteOldSaves(maxStorage: Int)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue