review


fix string warning
This commit is contained in:
Valere 2021-08-24 16:14:27 +02:00
parent b408d7346f
commit b9e2374a4c
4 changed files with 6 additions and 6 deletions

View File

@ -46,17 +46,17 @@ data class ActiveSpaceViewState(
class PromoteRestrictedViewModel @AssistedInject constructor( class PromoteRestrictedViewModel @AssistedInject constructor(
@Assisted initialState: ActiveSpaceViewState, @Assisted initialState: ActiveSpaceViewState,
private val activeSessionHolder: ActiveSessionHolder, private val activeSessionHolder: ActiveSessionHolder,
private val appStateHandler: AppStateHandler appStateHandler: AppStateHandler
) : VectorViewModel<ActiveSpaceViewState, EmptyAction, EmptyViewEvents>(initialState) { ) : VectorViewModel<ActiveSpaceViewState, EmptyAction, EmptyViewEvents>(initialState) {
init { init {
appStateHandler.selectedRoomGroupingObservable.distinctUntilChanged().execute { appStateHandler.selectedRoomGroupingObservable.distinctUntilChanged().execute { state ->
val groupingMethod = it.invoke()?.orNull() val groupingMethod = state.invoke()?.orNull()
val isSpaceMode = groupingMethod is RoomGroupingMethod.BySpace val isSpaceMode = groupingMethod is RoomGroupingMethod.BySpace
val currentSpace = (groupingMethod as? RoomGroupingMethod.BySpace)?.spaceSummary val currentSpace = (groupingMethod as? RoomGroupingMethod.BySpace)?.spaceSummary
val canManage = currentSpace?.roomId?.let { roomId -> val canManage = currentSpace?.roomId?.let { roomId ->
activeSessionHolder.getSafeActiveSession() activeSessionHolder.getSafeActiveSession()
?.getRoom(currentSpace.roomId) ?.getRoom(roomId)
?.getStateEvent(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.NoCondition) ?.getStateEvent(EventType.STATE_ROOM_POWER_LEVELS, QueryStringValue.NoCondition)
?.content?.toModel<PowerLevelsContent>()?.let { ?.content?.toModel<PowerLevelsContent>()?.let {
PowerLevelsHelper(it).isUserAllowedToSend(activeSessionHolder.getActiveSession().myUserId, true, EventType.STATE_SPACE_CHILD) PowerLevelsHelper(it).isUserAllowedToSend(activeSessionHolder.getActiveSession().myUserId, true, EventType.STATE_SPACE_CHILD)

View File

@ -72,7 +72,7 @@ class MigrateRoomBottomSheet :
if (state.migrationReason == MigrationReason.MANUAL) { if (state.migrationReason == MigrationReason.MANUAL) {
views.descriptionText.text = getString(R.string.upgrade_room_warning) views.descriptionText.text = getString(R.string.upgrade_room_warning)
views.upgradeFromTo.text = getString(R.string.upgrade_public_room_from_to, state.currentVersion, state.newVersion) views.upgradeFromTo.text = getString(R.string.upgrade_public_room_from_to_version, state.currentVersion, state.newVersion)
} else if (state.migrationReason == MigrationReason.FOR_RESTRICTED) { } else if (state.migrationReason == MigrationReason.FOR_RESTRICTED) {
views.descriptionText.setTextOrHide(state.customDescription) views.descriptionText.setTextOrHide(state.customDescription)
views.upgradeFromTo.text = getString(R.string.upgrade_room_for_restricted_note) views.upgradeFromTo.text = getString(R.string.upgrade_room_for_restricted_note)

View File

@ -66,7 +66,6 @@ class RestrictedPromoBottomSheet : VectorBaseBottomSheetDialogFragment<BottomShe
views.imageHint.isVisible = false views.imageHint.isVisible = false
views.bottomDescription.isVisible = false views.bottomDescription.isVisible = false
views.skipButton.isVisible = true views.skipButton.isVisible = true
views.learnMore.isVisible = true
views.learnMore.text = getString(R.string.learn_more) views.learnMore.text = getString(R.string.learn_more)
} }
} }

View File

@ -3505,6 +3505,7 @@
<string name="upgrade_private_room">Upgrade private room</string> <string name="upgrade_private_room">Upgrade private room</string>
<string name="upgrade_room_warning">Upgrading a room is an advanced action and is usually recommended when a room is unstable due to bugs, missing features or security vulnerabilities.\nThis usually only affects how the room is processed on the server.</string> <string name="upgrade_room_warning">Upgrading a room is an advanced action and is usually recommended when a room is unstable due to bugs, missing features or security vulnerabilities.\nThis usually only affects how the room is processed on the server.</string>
<string name="upgrade_public_room_from_to">You\'ll upgrade this room from %s to %s.</string> <string name="upgrade_public_room_from_to">You\'ll upgrade this room from %s to %s.</string>
<string name="upgrade_public_room_from_to_version">You\'ll upgrade this room from %1$s to %2$s.</string>
<string name="upgrade_room_auto_invite">Automatically invite users</string> <string name="upgrade_room_auto_invite">Automatically invite users</string>
<string name="upgrade_room_update_parent_space">Automatically update space parent</string> <string name="upgrade_room_update_parent_space">Automatically update space parent</string>
<string name="upgrade_room_no_power_to_manage">You need permission to upgrade a room</string> <string name="upgrade_room_no_power_to_manage">You need permission to upgrade a room</string>