Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fixes url bar shape when payment is disabled (#8207)
Browse files Browse the repository at this point in the history
Resolves #8170

Auditors: @srirambv @bsclifton

Test Plan:
- with payments disabled visit a site
- url border should be shaped
  • Loading branch information
NejcZdovc authored and bsclifton committed Apr 11, 2017
1 parent 1cf9761 commit 92d3630
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/renderer/components/navigation/navigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ class NavigationBar extends ImmutableComponent {
}

get visiblePublisher () {
// No publisher is visible if ledger is disabled
if (!getSetting(settings.PAYMENTS_ENABLED) || !this.publisherId) {
return false
}
const hostPattern = UrlUtil.getHostPattern(this.publisherId)
const hostSettings = this.props.siteSettings.get(hostPattern)
const ledgerPaymentsShown = hostSettings && hostSettings.get('ledgerPaymentsShown')
Expand All @@ -144,6 +140,12 @@ class NavigationBar extends ImmutableComponent {
: true
}

get isPublisherButtonEnabled () {
return getSetting(settings.PAYMENTS_ENABLED) &&
UrlUtil.isHttpOrHttps(this.props.location) &&
this.visiblePublisher
}

componentDidMount () {
ipc.on(messages.SHORTCUT_ACTIVE_FRAME_BOOKMARK, () => this.onToggleBookmark())
ipc.on(messages.SHORTCUT_ACTIVE_FRAME_REMOVE_BOOKMARK, () => this.onToggleBookmark())
Expand Down Expand Up @@ -245,7 +247,7 @@ class NavigationBar extends ImmutableComponent {
urlbar={this.props.navbar.get('urlbar')}
onStop={this.onStop}
menubarVisible={this.props.menubarVisible}
noBorderRadius={!isSourceAboutUrl(this.props.location)}
noBorderRadius={this.isPublisherButtonEnabled}
activeTabShowingMessageBox={this.props.activeTabShowingMessageBox}
/>
{
Expand Down

0 comments on commit 92d3630

Please sign in to comment.