kopia lustrzana https://github.com/vitorpamplona/amethyst
add support for amber in the follow dropdown menu
rodzic
a450dcbac1
commit
c223c1372b
|
@ -325,8 +325,10 @@ private fun RenderMainPopup(
|
|||
stringResource(R.string.quick_action_follow)
|
||||
) {
|
||||
scope.launch(Dispatchers.IO) {
|
||||
accountViewModel.follow(note.author!!)
|
||||
onDismiss()
|
||||
event = accountViewModel.follow(note.author!!, !accountViewModel.loggedInWithAmber())
|
||||
if (!accountViewModel.loggedInWithAmber()) {
|
||||
onDismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -416,11 +416,15 @@ fun NoteDropDownMenu(note: Note, popupExpanded: MutableState<Boolean>, accountVi
|
|||
}
|
||||
|
||||
if (!state.isFollowingAuthor) {
|
||||
DropdownMenuItem(onClick = {
|
||||
accountViewModel.follow(
|
||||
note.author ?: return@DropdownMenuItem
|
||||
); onDismiss()
|
||||
}) {
|
||||
DropdownMenuItem(
|
||||
onClick = {
|
||||
val author = note.author ?: return@DropdownMenuItem
|
||||
event = accountViewModel.follow(author, !accountViewModel.loggedInWithAmber())
|
||||
if (!accountViewModel.loggedInWithAmber()) {
|
||||
onDismiss()
|
||||
}
|
||||
}
|
||||
) {
|
||||
Text(stringResource(R.string.follow))
|
||||
}
|
||||
Divider()
|
||||
|
|
|
@ -269,7 +269,7 @@ fun ShowFollowingOrUnfollowingButton(
|
|||
}
|
||||
} else {
|
||||
scope.launch(Dispatchers.IO) {
|
||||
accountViewModel.follow(baseAuthor)
|
||||
accountViewModel.follow(baseAuthor, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import com.vitorpamplona.amethyst.ui.note.ZapraiserStatus
|
|||
import com.vitorpamplona.amethyst.ui.note.showAmount
|
||||
import com.vitorpamplona.quartz.encoders.HexKey
|
||||
import com.vitorpamplona.quartz.events.BookmarkListEvent
|
||||
import com.vitorpamplona.quartz.events.ContactListEvent
|
||||
import com.vitorpamplona.quartz.events.DeletionEvent
|
||||
import com.vitorpamplona.quartz.events.Event
|
||||
import com.vitorpamplona.quartz.events.GiftWrapEvent
|
||||
|
@ -375,8 +376,8 @@ class AccountViewModel(val account: Account) : ViewModel() {
|
|||
account.prefer(source, target, preference)
|
||||
}
|
||||
|
||||
fun follow(user: User) {
|
||||
account.follow(user)
|
||||
fun follow(user: User, signEvent: Boolean): ContactListEvent? {
|
||||
return account.follow(user, signEvent)
|
||||
}
|
||||
|
||||
fun unfollow(user: User) {
|
||||
|
|
Ładowanie…
Reference in New Issue