Skip to content

Commit

Permalink
Fixed display for multiplehomepages
Browse files Browse the repository at this point in the history
Resolves brave#7442

Auditors: @darkdh

Test Plan:
- described in brave#7442
  • Loading branch information
NejcZdovc committed Mar 2, 2017
1 parent 793c175 commit 8fba23a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,17 +561,21 @@ class GeneralTab extends ImmutableComponent {
}

render () {
var languageOptions = this.props.languageCodes.map(function (lc) {
const languageOptions = this.props.languageCodes.map(function (lc) {
return (
<option data-l10n-id={lc} value={lc} />
)
})
var homepageValue = getSetting(settings.HOMEPAGE, this.props.settings)

let homepageValue = getSetting(settings.HOMEPAGE, this.props.settings)
if (typeof homepageValue === 'string') {
const punycodeUrl = UrlUtil.getPunycodeUrl(homepageValue)
if (punycodeUrl.replace(/\/$/, '') !== homepageValue) {
homepageValue = UrlUtil.getPunycodeUrl(homepageValue)
}

// we use | as a separator for multiple home pages
homepageValue = homepageValue.replace(/%7C/g, '|')
}
const homepage = homepageValue && homepageValue.trim()
const disableShowHomeButton = !homepage || !homepage.length
Expand Down

0 comments on commit 8fba23a

Please sign in to comment.