feat(creator): 채널 본인 상태를 계산한다
This commit is contained in:
@@ -6,7 +6,7 @@ import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelHomeRespon
|
|||||||
import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelSnsResponse
|
import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelSnsResponse
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
|
||||||
fun CreatorChannelHomeResponse.toUiContent(): CreatorChannelHomeUiState.Content {
|
fun CreatorChannelHomeResponse.toUiContent(currentMemberId: Long): CreatorChannelHomeUiState.Content {
|
||||||
val sections = buildList {
|
val sections = buildList {
|
||||||
currentLive?.let { add(CreatorChannelHomeSection.CurrentLive(it)) }
|
currentLive?.let { add(CreatorChannelHomeSection.CurrentLive(it)) }
|
||||||
latestAudioContent?.let { add(CreatorChannelHomeSection.LatestAudioContent(it)) }
|
latestAudioContent?.let { add(CreatorChannelHomeSection.LatestAudioContent(it)) }
|
||||||
@@ -34,7 +34,8 @@ fun CreatorChannelHomeResponse.toUiContent(): CreatorChannelHomeUiState.Content
|
|||||||
isFollow = creator.isFollow,
|
isFollow = creator.isFollow,
|
||||||
isNotify = creator.isNotify,
|
isNotify = creator.isNotify,
|
||||||
isAiChatAvailable = creator.isAiChatAvailable,
|
isAiChatAvailable = creator.isAiChatAvailable,
|
||||||
isDmAvailable = creator.isDmAvailable
|
isDmAvailable = creator.isDmAvailable,
|
||||||
|
isOwner = creator.creatorId == currentMemberId
|
||||||
),
|
),
|
||||||
tabs = CreatorChannelTab.entries,
|
tabs = CreatorChannelTab.entries,
|
||||||
sections = sections
|
sections = sections
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ data class CreatorChannelHeaderUiModel(
|
|||||||
val isFollow: Boolean,
|
val isFollow: Boolean,
|
||||||
val isNotify: Boolean,
|
val isNotify: Boolean,
|
||||||
val isAiChatAvailable: Boolean,
|
val isAiChatAvailable: Boolean,
|
||||||
val isDmAvailable: Boolean
|
val isDmAvailable: Boolean,
|
||||||
|
val isOwner: Boolean
|
||||||
)
|
)
|
||||||
|
|
||||||
sealed interface CreatorChannelHomeSection {
|
sealed interface CreatorChannelHomeSection {
|
||||||
|
|||||||
Reference in New Issue
Block a user