Open
Conversation
5eac33c to
85c7625
Compare
|
|
||
| fun registration(context: Context, clearStack: Boolean = false) { | ||
| context.startActivity(Intent(context, RegistrationActivity::class.java).apply { | ||
| if (clearStack) { |
| } | ||
|
|
||
| }) | ||
| return isSuccessful |
There was a problem hiding this comment.
Тут вроде isSuccessful всегда будет true возвращаться. Запрос асинхронный и не успеет поменять isSuccesful
| showFirstName(it.firstName) | ||
| showLastName(it.lastName) | ||
| if (it.avatarUrl.isEmpty()) { | ||
| print("EMPTY AVATAR URL!!!!!!!!!!!!!!!!!!!!!!!!!!") |
| var isSuccessful = false | ||
| okHttpClient | ||
| .newCall(request) | ||
| .enqueue(object : Callback { |
There was a problem hiding this comment.
Как вариант, ты весь метод можешь обернуть в suspendCancellableCoroutine
suspend fun uploadImageToAws(url: String, fields: Map<String, String>, file: File) : Boolean= suspendCancellableCoroutine {
...
override fun onFailure(call: Call, e: IOException) {
continuation.resume(false)// or continuation.resumeWithException(e)
}
override fun onResponse(call: Call, response: Response) {
continuation.resume(true)
}
}
| import org.kodein.di.KodeinAware | ||
| import org.kodein.di.android.kodein | ||
| import org.kodein.di.generic.instance | ||
|
|
| ) | ||
| } | ||
|
|
||
| private fun navigateToProfile(context: Context) { |
There was a problem hiding this comment.
Context в делегате выглядит как-то не оч
68b4cc9 to
8bbe978
Compare
yaroslavsudnik
approved these changes
Jun 7, 2021
8bbe978 to
246ff85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sign up with avatar uploading feature (via amazon services), made by Ruslan's PDP