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

Avoid race condition on publisherToggle #7498

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/renderer/components/publisherToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ class PublisherToggle extends ImmutableComponent {
}

render () {
if (!this.props.locationInfo) {
return null
}
return this.shouldShowAddPublisherButton
? <span
data-test-id='publisherButton'
Expand Down
4 changes: 2 additions & 2 deletions js/components/navigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ class NavigationBar extends ImmutableComponent {
}

get publisherId () {
return (this.props.locationInfo && this.props.locationInfo.getIn([this.locationId, 'publisher'])) || ''
return this.props.locationInfo && this.props.locationInfo.getIn([this.locationId, 'publisher'])
}

get visiblePublisher () {
// No publisher is visible if ledger is disabled
if (!getSetting(settings.PAYMENTS_ENABLED)) {
if (!getSetting(settings.PAYMENTS_ENABLED) || !this.publisherId) {
return false
}
const hostPattern = UrlUtil.getHostPattern(this.publisherId)
Expand Down