diff --git a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt index ee388b336c..e192ec3c88 100644 --- a/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt +++ b/vector/src/main/java/im/vector/app/features/spaces/manage/SpaceAddRoomFragment.kt @@ -117,6 +117,8 @@ class SpaceAddRoomFragment @Inject constructor( spaceEpoxyController.disabled = !it roomEpoxyController.disabled = it views.createNewRoom.text = if (it) getString(R.string.create_space) else getString(R.string.create_new_room) + val title = if (it) getString(R.string.space_add_existing_spaces) else getString(R.string.space_add_existing_rooms_only) + views.appBarTitle.text = title }.disposeOnDestroyView() views.createNewRoom.debouncedClicks { @@ -152,14 +154,6 @@ class SpaceAddRoomFragment @Inject constructor( } } - override fun onResume() { - super.onResume() - withState(viewModel) { state -> - val title = if (state.onlyShowSpaces) getString(R.string.space_add_existing_spaces) else getString(R.string.space_add_existing_rooms_only) - views.appBarTitle.text = title - } - } - override fun onPrepareOptionsMenu(menu: Menu) { super.onPrepareOptionsMenu(menu) menu.findItem(R.id.spaceAddRoomSaveItem).isVisible = saveNeeded