For #21776 - Replace 'isEmpty' with 'ifEmpty'

upstream-sync
Gabriel Luong 3 years ago committed by mergify[bot]
parent 603ba63962
commit 660300f770

@ -156,9 +156,7 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan
// Reload bookmarks when returning to this fragment in case they have been edited
val args by navArgs<BookmarkFragmentArgs>()
val currentGuid = bookmarkStore.state.tree?.guid
?: if (args.currentRoot.isNotEmpty()) {
args.currentRoot
} else {
?: args.currentRoot.ifEmpty {
BookmarkRoot.Mobile.id
}
loadInitialBookmarkFolder(currentGuid)

@ -33,7 +33,7 @@ class RecentlyClosedItemViewHolder(
fun bind(item: RecoverableTab) {
binding.historyLayout.titleView.text =
if (item.title.isNotEmpty()) item.title else item.url
item.title.ifEmpty { item.url }
binding.historyLayout.urlView.text = item.url
binding.historyLayout.setSelectionInteractor(

@ -135,9 +135,7 @@ class ToolbarView(
if (searchState.pastedText.isNullOrEmpty()) {
// If we're in edit mode, setting the search term will update the toolbar,
// so we make sure we have the correct term/query to show.
val termOrQuery = if (searchState.searchTerms.isNotEmpty()) {
searchState.searchTerms
} else {
val termOrQuery = searchState.searchTerms.ifEmpty {
searchState.query
}
view.setSearchTerms(termOrQuery)

@ -124,9 +124,7 @@ abstract class AbstractBrowserTabViewHolder(
}
private fun updateTitle(tab: TabSessionState) {
val title = if (tab.content.title.isNotEmpty()) {
tab.content.title
} else {
val title = tab.content.title.ifEmpty {
tab.content.url
}
titleView.text = title

Loading…
Cancel
Save