diff --git a/internal_packages/message-list/lib/find-in-thread.jsx b/internal_packages/message-list/lib/find-in-thread.jsx index fa3f6e052..945f4e4da 100644 --- a/internal_packages/message-list/lib/find-in-thread.jsx +++ b/internal_packages/message-list/lib/find-in-thread.jsx @@ -61,7 +61,9 @@ export default class FindInThread extends React.Component { return "" } - _navEnabled() { return this.state.resultsLength > 0 } + _navEnabled() { + return this.state.resultsLength > 0; + } _onPrevResult = () => { if (this._navEnabled()) { Actions.previousSearchResult() } diff --git a/src/components/scroll-region.cjsx b/src/components/scroll-region.cjsx index 4118b38d7..aa8b2ebdf 100644 --- a/src/components/scroll-region.cjsx +++ b/src/components/scroll-region.cjsx @@ -31,7 +31,7 @@ class Scrollbar extends React.Component componentDidMount: -> if @props.scrollbarTickProvider?.listen - @_tickUnsub = @props.scrollbarTickProvider.listen(@_onTickProvider) + @_tickUnsub = @props.scrollbarTickProvider.listen(@_onTickProviderChange) shouldComponentUpdate: (nextProps, nextState) => not Utils.isEqualReact(nextProps, @props) or @@ -69,7 +69,7 @@ class Scrollbar extends React.Component @props.getScrollRegion()._recomputeDimensions(options) @_recomputeDimensions(options) - _onTickProvider: => + _onTickProviderChange: => if not @props.scrollbarTickProvider?.scrollbarTicks throw new Error("The scrollbarTickProvider must implement `scrollbarTicks`") @setState scrollbarTicks: @props.scrollbarTickProvider.scrollbarTicks() diff --git a/src/flux/stores/searchable-component-store.es6 b/src/flux/stores/searchable-component-store.es6 index 4bbd63440..8f34fed30 100644 --- a/src/flux/stores/searchable-component-store.es6 +++ b/src/flux/stores/searchable-component-store.es6 @@ -23,15 +23,12 @@ class SearchableComponentStore extends NylasStore { this.listenTo(Actions.previousSearchResult, this._previousSearchResult) } - /** - * The searchIndex - */ getCurrentRegionIndex(regionId) { - let searchIndex = null; + let regionOffset = null; if (regionId && this.currentMatch && this.currentMatch.node.getAttribute('data-region-id') === regionId) { - searchIndex = +this.currentMatch.node.getAttribute('data-render-index') + regionOffset = +this.currentMatch.node.getAttribute('data-render-index') } - return searchIndex + return regionOffset } getCurrentSearchData() {