diff options
author | 2019-09-13 17:59:46 +0200 | |
---|---|---|
committer | 2019-09-13 17:59:46 +0200 | |
commit | fb095e4984210ec63c5834d6762dec43457dbc57 (patch) | |
tree | a2c8b353313cb363a56722687e110c6f80f4b791 /src/lib | |
parent | Use ferdi namespace on debugger (diff) | |
parent | Update CHANGELOG.md (diff) | |
download | ferdium-app-fb095e4984210ec63c5834d6762dec43457dbc57.tar.gz ferdium-app-fb095e4984210ec63c5834d6762dec43457dbc57.tar.zst ferdium-app-fb095e4984210ec63c5834d6762dec43457dbc57.zip |
Merge branch 'master' of https://github.com/meetfranz/franz into meetfranz-master
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index e36b03977..7af1b36cb 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -7,7 +7,6 @@ import { workspaceStore } from '../features/workspaces/index'; | |||
7 | import { workspaceActions } from '../features/workspaces/actions'; | 7 | import { workspaceActions } from '../features/workspaces/actions'; |
8 | import { announcementActions } from '../features/announcements/actions'; | 8 | import { announcementActions } from '../features/announcements/actions'; |
9 | import { announcementsStore } from '../features/announcements'; | 9 | import { announcementsStore } from '../features/announcements'; |
10 | import TodoStore from '../features/todos/store'; | ||
11 | import { todosStore } from '../features/todos'; | 10 | import { todosStore } from '../features/todos'; |
12 | import { todoActions } from '../features/todos/actions'; | 11 | import { todoActions } from '../features/todos/actions'; |
13 | 12 | ||
@@ -258,6 +257,10 @@ const menuItems = defineMessages({ | |||
258 | id: 'menu.Todoss.closeTodosDrawer', | 257 | id: 'menu.Todoss.closeTodosDrawer', |
259 | defaultMessage: '!!!Close Todos drawer', | 258 | defaultMessage: '!!!Close Todos drawer', |
260 | }, | 259 | }, |
260 | enableTodos: { | ||
261 | id: 'menu.todos.enableTodos', | ||
262 | defaultMessage: '!!!Enable Todos', | ||
263 | }, | ||
261 | }); | 264 | }); |
262 | 265 | ||
263 | function getActiveWebview() { | 266 | function getActiveWebview() { |
@@ -922,25 +925,33 @@ export default class FranzMenu { | |||
922 | } | 925 | } |
923 | 926 | ||
924 | todosMenu() { | 927 | todosMenu() { |
925 | const { isTodosPanelVisible } = TodoStore; | 928 | const { isTodosPanelVisible, isFeatureEnabledByUser } = this.stores.todos; |
926 | const { intl } = window.ferdi; | 929 | const { intl } = window.franz; |
927 | const menu = []; | 930 | const menu = []; |
928 | 931 | ||
929 | // Open todos drawer: | 932 | const drawerLabel = isTodosPanelVisible ? menuItems.closeTodosDrawer : menuItems.openTodosDrawer; |
930 | const drawerLabel = ( | 933 | |
931 | isTodosPanelVisible ? menuItems.closeTodosDrawer : menuItems.openTodosDrawer | ||
932 | ); | ||
933 | menu.push({ | 934 | menu.push({ |
934 | label: intl.formatMessage(drawerLabel), | 935 | label: intl.formatMessage(drawerLabel), |
935 | accelerator: `${cmdKey}+T`, | 936 | accelerator: `${cmdKey}+T`, |
936 | click: () => { | 937 | click: () => { |
937 | todoActions.toggleTodosPanel(); | 938 | todoActions.toggleTodosPanel(); |
938 | }, | 939 | }, |
939 | enabled: this.stores.user.isLoggedIn, | 940 | enabled: this.stores.user.isLoggedIn && isFeatureEnabledByUser, |
940 | }, { | 941 | }, { |
941 | type: 'separator', | 942 | type: 'separator', |
942 | }); | 943 | }); |
943 | 944 | ||
945 | if (!isFeatureEnabledByUser) { | ||
946 | menu.push({ | ||
947 | label: intl.formatMessage(menuItems.enableTodos), | ||
948 | click: () => { | ||
949 | todoActions.toggleTodosFeatureVisibility(); | ||
950 | gaEvent(GA_CATEGORY_TODOS, 'enable', 'menu'); | ||
951 | }, | ||
952 | }); | ||
953 | } | ||
954 | |||
944 | return menu; | 955 | return menu; |
945 | } | 956 | } |
946 | 957 | ||