mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 11:57:29 +01:00
Fixes live flag when the URL is not available anymore.
This commit is contained in:
@@ -164,7 +164,11 @@ fun RenderLiveActivityEventInner(
|
||||
CrossfadeIfEnabled(targetState = status, label = "RenderLiveActivityEventInner", accountViewModel = accountViewModel) {
|
||||
when (it) {
|
||||
StatusTag.STATUS.LIVE -> {
|
||||
media?.let { CrossfadeCheckIfVideoIsOnline(it, accountViewModel) { LiveFlag() } }
|
||||
media?.let {
|
||||
CrossfadeCheckIfVideoIsOnline(it, accountViewModel) {
|
||||
LiveFlag()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StatusTag.STATUS.PLANNED -> {
|
||||
|
||||
@@ -46,6 +46,8 @@ import com.vitorpamplona.amethyst.ui.note.UserPicture
|
||||
import com.vitorpamplona.amethyst.ui.note.ZapReaction
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.nip53LiveActivities.LiveFlag
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.nip53LiveActivities.OfflineFlag
|
||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.CheckIfVideoIsOnline
|
||||
import com.vitorpamplona.amethyst.ui.theme.RowColSpacing
|
||||
import com.vitorpamplona.amethyst.ui.theme.Size34dp
|
||||
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
||||
@@ -130,9 +132,16 @@ fun LiveChannelActionOptions(
|
||||
nav: INav,
|
||||
) {
|
||||
val isLive by remember(activity) { derivedStateOf { activity.isLive() } }
|
||||
val url = activity.streaming()
|
||||
|
||||
if (showFlag && isLive) {
|
||||
LiveFlag()
|
||||
if (showFlag && isLive && url != null) {
|
||||
CheckIfVideoIsOnline(url, accountViewModel) { isOnline ->
|
||||
if (isOnline) {
|
||||
LiveFlag()
|
||||
} else {
|
||||
OfflineFlag()
|
||||
}
|
||||
}
|
||||
Spacer(modifier = StdHorzSpacer)
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ fun RenderLiveActivityThumb(
|
||||
StatusTag.STATUS.LIVE -> {
|
||||
val url = card.media
|
||||
if (url.isNullOrBlank()) {
|
||||
LiveFlag()
|
||||
EndedFlag()
|
||||
} else {
|
||||
CheckIfVideoIsOnline(url, accountViewModel) { isOnline ->
|
||||
if (isOnline) {
|
||||
|
||||
Reference in New Issue
Block a user