mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-16 02:05:06 +08:00
Simpler code
This commit is contained in:
parent
9c1475d2f1
commit
d2a1041a51
@ -46,7 +46,7 @@ class ActiveConferenceView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
var callback: Callback? = null
|
var callback: Callback? = null
|
||||||
var jitsiWidget: Widget? = null
|
private var jitsiWidget: Widget? = null
|
||||||
|
|
||||||
private lateinit var views: ViewActiveConferenceViewBinding
|
private lateinit var views: ViewActiveConferenceViewBinding
|
||||||
|
|
||||||
@ -95,18 +95,12 @@ class ActiveConferenceView @JvmOverloads constructor(
|
|||||||
val summary = state.asyncRoomSummary()
|
val summary = state.asyncRoomSummary()
|
||||||
if (summary?.membership == Membership.JOIN) {
|
if (summary?.membership == Membership.JOIN) {
|
||||||
// We only display banner for 'live' widgets
|
// We only display banner for 'live' widgets
|
||||||
val activeConf =
|
jitsiWidget = state.activeRoomWidgets()?.firstOrNull {
|
||||||
state.activeRoomWidgets()?.firstOrNull {
|
// for now only jitsi?
|
||||||
// for now only jitsi?
|
it.type == WidgetType.Jitsi
|
||||||
it.type == WidgetType.Jitsi
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activeConf == null) {
|
|
||||||
isVisible = false
|
|
||||||
} else {
|
|
||||||
isVisible = true
|
|
||||||
jitsiWidget = activeConf
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isVisible = jitsiWidget != null
|
||||||
// if sent by me or if i can moderate?
|
// if sent by me or if i can moderate?
|
||||||
views.deleteWidgetButton.isVisible = state.isAllowedToManageWidgets
|
views.deleteWidgetButton.isVisible = state.isAllowedToManageWidgets
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user