For #16790 - Allow top sites to have an empty name when renamed (#17290)

upstream-sync
Gabriel Luong 3 years ago committed by GitHub
parent afa0454f2b
commit d0fc086fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -321,12 +321,9 @@ class DefaultSessionControlController(
setTitle(R.string.rename_top_site)
setView(customLayout)
setPositiveButton(R.string.top_sites_rename_dialog_ok) { dialog, _ ->
val newTitle = topSiteLabelEditText.text.toString()
if (newTitle.isNotBlank()) {
viewLifecycleScope.launch(Dispatchers.IO) {
with(activity.components.useCases.topSitesUseCase) {
renameTopSites(topSite, newTitle)
}
viewLifecycleScope.launch(Dispatchers.IO) {
with(activity.components.useCases.topSitesUseCase) {
renameTopSites(topSite, topSiteLabelEditText.text.toString())
}
}
dialog.dismiss()

Loading…
Cancel
Save