mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Add WellknownRetrieverResul.upToDateDataOrNull helper function for the enterprise module
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
b9afbf0692
commit
89908c2511
+7
@@ -35,4 +35,11 @@ sealed interface WellknownRetrieverResult<out T> {
|
||||
is Error -> null
|
||||
NotFound -> null
|
||||
}
|
||||
|
||||
fun upToDateDataOrNull(): T? = when (this) {
|
||||
is Success<T> -> data
|
||||
is Outdated<T> -> null
|
||||
is Error -> null
|
||||
NotFound -> null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user