diff --git a/lib/controllers/git-panel-controller.js b/lib/controllers/git-panel-controller.js index b8982d38f4..af06bccd24 100644 --- a/lib/controllers/git-panel-controller.js +++ b/lib/controllers/git-panel-controller.js @@ -93,7 +93,7 @@ export default class GitPanelController { branches: await repository.getBranches(), aheadCount: null, behindCount: null, - remoteName: await repository.getRemote(this.branchName) + remoteName: await repository.getRemoteForBranch(this.branchName) } if (data.remoteName) { diff --git a/lib/controllers/status-bar-tile-controller.js b/lib/controllers/status-bar-tile-controller.js index 545540b86b..f0b999957d 100644 --- a/lib/controllers/status-bar-tile-controller.js +++ b/lib/controllers/status-bar-tile-controller.js @@ -17,12 +17,22 @@ export default class StatusBarTileController { this.push = this.push.bind(this) this.pull = this.pull.bind(this) this.fetch = this.fetch.bind(this) - this.disposables = new CompositeDisposable() this.branchMenuView = null this.pushPullMenuView = null + this.branchTooltipDisposable = null + this.pushPullTooltipDisposable = null this.repositoryObserver = new ModelObserver({ fetchData: this.fetchRepositoryData.bind(this), - didUpdate: () => etch.update(this) + didUpdate: () => { + // Since changing repositories causes the destruction of the DOM + // elements that the tooltips are bound to, we get rid of the old + // disposables & create new tooltips when the disposables are nulled out + this.branchTooltipDisposable && this.branchTooltipDisposable.dispose() + this.pushPullTooltipDisposable && this.pushPullTooltipDisposable.dispose() + this.branchTooltipDisposable = null + this.pushPullTooltipDisposable = null + return etch.update(this) + } }) this.repositoryObserver.setActiveModel(props.repository) etch.initialize(this) @@ -37,13 +47,6 @@ export default class StatusBarTileController { render () { const modelData = this.repositoryObserver.getActiveModelData() - const pushPullView = ( - - ) - if (modelData) { return (
@@ -52,7 +55,10 @@ export default class StatusBarTileController { {...modelData} workspace={this.props.workspace} checkout={this.checkout} /> - { modelData.remoteName ? pushPullView :