forked from GitHub-Mirror/riotX-android
Cleaner API
This commit is contained in:
parent
394b89e76b
commit
dafdc1d3ad
@ -27,7 +27,7 @@ internal interface SessionParamsStore {
|
||||
|
||||
fun getAll(): List<SessionParams>
|
||||
|
||||
fun save(sessionParams: SessionParams): Try<SessionParams>
|
||||
fun save(sessionParams: SessionParams): Try<Unit>
|
||||
|
||||
fun delete(userId: String): Try<Unit>
|
||||
|
||||
|
@ -62,7 +62,7 @@ internal class RealmSessionParamsStore @Inject constructor(private val mapper: S
|
||||
return sessionParams
|
||||
}
|
||||
|
||||
override fun save(sessionParams: SessionParams): Try<SessionParams> {
|
||||
override fun save(sessionParams: SessionParams): Try<Unit> {
|
||||
return Try {
|
||||
val entity = mapper.map(sessionParams)
|
||||
if (entity != null) {
|
||||
@ -72,7 +72,6 @@ internal class RealmSessionParamsStore @Inject constructor(private val mapper: S
|
||||
}
|
||||
realm.close()
|
||||
}
|
||||
sessionParams
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user