diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-11-20 13:35:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 13:35:24 +0100 |
commit | d8fe16301a3f0ce7fbfb1e771099c8e1a1468750 (patch) | |
tree | b6f2e4a58b58bb8ab7d1469b22799dce57ef9298 | |
parent | fix(Windows): Fix notifications on Windows 10 (diff) | |
parent | Prevent sorting services by clicking in the tab bar background (diff) | |
download | ferdium-app-d8fe16301a3f0ce7fbfb1e771099c8e1a1468750.tar.gz ferdium-app-d8fe16301a3f0ce7fbfb1e771099c8e1a1468750.tar.zst ferdium-app-d8fe16301a3f0ce7fbfb1e771099c8e1a1468750.zip |
fix(Sidebar): Fix sidebar tab sorting (@josescgar)
Closes #283
-rw-r--r-- | src/components/services/tabs/Tabbar.js | 3 | ||||
-rw-r--r-- | src/stores/ServicesStore.js | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/components/services/tabs/Tabbar.js b/src/components/services/tabs/Tabbar.js index fd4325107..9da1090b7 100644 --- a/src/components/services/tabs/Tabbar.js +++ b/src/components/services/tabs/Tabbar.js | |||
@@ -30,6 +30,8 @@ export default class TabBar extends Component { | |||
30 | reorder({ oldIndex, newIndex }); | 30 | reorder({ oldIndex, newIndex }); |
31 | }; | 31 | }; |
32 | 32 | ||
33 | shouldPreventSorting = event => event.target.tagName !== 'LI'; | ||
34 | |||
33 | toggleService = ({ serviceId, isEnabled }) => { | 35 | toggleService = ({ serviceId, isEnabled }) => { |
34 | const { updateService } = this.props; | 36 | const { updateService } = this.props; |
35 | 37 | ||
@@ -71,6 +73,7 @@ export default class TabBar extends Component { | |||
71 | setActive={setActive} | 73 | setActive={setActive} |
72 | onSortEnd={this.onSortEnd} | 74 | onSortEnd={this.onSortEnd} |
73 | onSortStart={disableToolTip} | 75 | onSortStart={disableToolTip} |
76 | shouldCancelStart={this.shouldPreventSorting} | ||
74 | reload={reload} | 77 | reload={reload} |
75 | toggleNotifications={toggleNotifications} | 78 | toggleNotifications={toggleNotifications} |
76 | toggleAudio={toggleAudio} | 79 | toggleAudio={toggleAudio} |
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 9af5d81da..22c376c06 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -470,8 +470,10 @@ export default class ServicesStore extends Store { | |||
470 | const service = this.active; | 470 | const service = this.active; |
471 | 471 | ||
472 | if (service) { | 472 | if (service) { |
473 | this.stores.settings.updateSettingsRequest.execute({ | 473 | this.actions.settings.update({ |
474 | activeService: service.id, | 474 | settings: { |
475 | activeService: service.id, | ||
476 | }, | ||
475 | }); | 477 | }); |
476 | } | 478 | } |
477 | } | 479 | } |