Auth Case and Repo done
This commit is contained in:
1 parent
945b9d347d
commit
cbc91ee472
2 files changed
+7
-4
No files matched your search
@@ -7,10 +7,9 @@ object AuthRepository {
|
||||
private var codeCache: String? = null
|
||||
|
||||
suspend fun checkAndSave(text: String): Result<Boolean> {
|
||||
return NetworkDataSource.checkAuth(text).onSuccess { success ->
|
||||
if (success) {
|
||||
codeCache = text
|
||||
}
|
||||
return NetworkDataSource.checkAuth(text).mapCatching { success ->
|
||||
if (success) codeCache = text
|
||||
success
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user