3486: (Appease linter)
This commit is contained in:
parent
3a40274003
commit
45d2fa1570
|
@ -228,7 +228,6 @@ class EditProfileActivity : BaseActivity(), Injectable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
super.onStop()
|
super.onStop()
|
||||||
if (!isFinishing) {
|
if (!isFinishing) {
|
||||||
|
|
|
@ -42,7 +42,6 @@ import kotlinx.coroutines.flow.shareIn
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
import okhttp3.MultipartBody
|
import okhttp3.MultipartBody
|
||||||
import okhttp3.RequestBody
|
|
||||||
import okhttp3.RequestBody.Companion.asRequestBody
|
import okhttp3.RequestBody.Companion.asRequestBody
|
||||||
import okhttp3.RequestBody.Companion.toRequestBody
|
import okhttp3.RequestBody.Companion.toRequestBody
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
@ -123,12 +122,12 @@ class EditProfileViewModel @Inject constructor(
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
var avatarFileBody: MultipartBody.Part? = null
|
var avatarFileBody: MultipartBody.Part? = null
|
||||||
diff.avatarFile?.let {
|
diff.avatarFile?.let {
|
||||||
avatarFileBody = MultipartBody.Part.createFormData("avatar", randomAlphanumericString(12), it.asRequestBody("image/png".toMediaTypeOrNull()))
|
avatarFileBody = MultipartBody.Part.createFormData("avatar", randomAlphanumericString(12), it.asRequestBody("image/png".toMediaTypeOrNull()))
|
||||||
}
|
}
|
||||||
|
|
||||||
var headerFileBody: MultipartBody.Part? = null
|
var headerFileBody: MultipartBody.Part? = null
|
||||||
diff.headerFile?.let {
|
diff.headerFile?.let {
|
||||||
headerFileBody = MultipartBody.Part.createFormData("header", randomAlphanumericString(12), it.asRequestBody("image/png".toMediaTypeOrNull()))
|
headerFileBody = MultipartBody.Part.createFormData("header", randomAlphanumericString(12), it.asRequestBody("image/png".toMediaTypeOrNull()))
|
||||||
}
|
}
|
||||||
|
|
||||||
mastodonApi.accountUpdateCredentials(
|
mastodonApi.accountUpdateCredentials(
|
||||||
|
@ -144,7 +143,7 @@ class EditProfileViewModel @Inject constructor(
|
||||||
diff.field3?.first?.toRequestBody(MultipartBody.FORM),
|
diff.field3?.first?.toRequestBody(MultipartBody.FORM),
|
||||||
diff.field3?.second?.toRequestBody(MultipartBody.FORM),
|
diff.field3?.second?.toRequestBody(MultipartBody.FORM),
|
||||||
diff.field4?.first?.toRequestBody(MultipartBody.FORM),
|
diff.field4?.first?.toRequestBody(MultipartBody.FORM),
|
||||||
diff.field4?.second?.toRequestBody(MultipartBody.FORM),
|
diff.field4?.second?.toRequestBody(MultipartBody.FORM)
|
||||||
).fold(
|
).fold(
|
||||||
{ newAccountData ->
|
{ newAccountData ->
|
||||||
saveData.postValue(Success())
|
saveData.postValue(Success())
|
||||||
|
@ -226,7 +225,7 @@ class EditProfileViewModel @Inject constructor(
|
||||||
}
|
}
|
||||||
return Pair(
|
return Pair(
|
||||||
newField.name,
|
newField.name,
|
||||||
newField.value,
|
newField.value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue