Skip to content

Commit

Permalink
fix(Sidebar): Fix sidebar tab sorting (@josescgar)
Browse files Browse the repository at this point in the history
Closes #283
  • Loading branch information
adlk committed Nov 20, 2017
2 parents eea4801 + 86413ba commit d8fe163
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/services/tabs/Tabbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export default class TabBar extends Component {
reorder({ oldIndex, newIndex });
};

shouldPreventSorting = event => event.target.tagName !== 'LI';

toggleService = ({ serviceId, isEnabled }) => {
const { updateService } = this.props;

Expand Down Expand Up @@ -71,6 +73,7 @@ export default class TabBar extends Component {
setActive={setActive}
onSortEnd={this.onSortEnd}
onSortStart={disableToolTip}
shouldCancelStart={this.shouldPreventSorting}
reload={reload}
toggleNotifications={toggleNotifications}
toggleAudio={toggleAudio}
Expand Down
6 changes: 4 additions & 2 deletions src/stores/ServicesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,10 @@ export default class ServicesStore extends Store {
const service = this.active;

if (service) {
this.stores.settings.updateSettingsRequest.execute({
activeService: service.id,
this.actions.settings.update({
settings: {
activeService: service.id,
},
});
}
}
Expand Down

0 comments on commit d8fe163

Please sign in to comment.