Personal account notes (#1978)
* add personal notes to AccountActivity * use RxJava instead of plain okhttp calls * make AccountViewModel rx aware * hide note input until data is loaded
This commit is contained in:
parent
56219ddcc7
commit
ce973ea7e7
9 changed files with 181 additions and 213 deletions
|
|
@ -100,7 +100,7 @@ class ReportViewModel @Inject constructor(
|
|||
val ids = listOf(accountId)
|
||||
muteStateMutable.value = Loading()
|
||||
blockStateMutable.value = Loading()
|
||||
mastodonApi.relationshipsObservable(ids)
|
||||
mastodonApi.relationships(ids)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(
|
||||
|
|
@ -129,9 +129,9 @@ class ReportViewModel @Inject constructor(
|
|||
fun toggleMute() {
|
||||
val alreadyMuted = muteStateMutable.value?.data == true
|
||||
if (alreadyMuted) {
|
||||
mastodonApi.unmuteAccountObservable(accountId)
|
||||
mastodonApi.unmuteAccount(accountId)
|
||||
} else {
|
||||
mastodonApi.muteAccountObservable(accountId)
|
||||
mastodonApi.muteAccount(accountId)
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
|
@ -154,9 +154,9 @@ class ReportViewModel @Inject constructor(
|
|||
fun toggleBlock() {
|
||||
val alreadyBlocked = blockStateMutable.value?.data == true
|
||||
if (alreadyBlocked) {
|
||||
mastodonApi.unblockAccountObservable(accountId)
|
||||
mastodonApi.unblockAccount(accountId)
|
||||
} else {
|
||||
mastodonApi.blockAccountObservable(accountId)
|
||||
mastodonApi.blockAccount(accountId)
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue