Преглед на файлове

fix(toolbar) Fix toolbar always visible; refactors

- deprecate `INITIAL_TOOLBAR_TIMEOUT`, `TOOLBAR_ALWAYS_VISIBLE`, `TOOLBAR_TIMEOUT`
master
hmuresan преди 3 години
родител
ревизия
cd4c940107

+ 13
- 0
config.js Целия файл

@@ -545,6 +545,19 @@ var config = {
545 545
     //    '__end'
546 546
     // ],
547 547
 
548
+    // Holds values related to toolbar visibility control.
549
+    // toolbarConfig: {
550
+    //     // Moved from interfaceConfig.INITIAL_TOOLBAR_TIMEOUT
551
+    //     // The initial numer of miliseconds for the toolbar buttons to be visible on screen.
552
+    //     initialTimeout: 20000,
553
+    //     // Moved from interfaceConfig.TOOLBAR_TIMEOUT
554
+    //     // Number of miliseconds for the toolbar buttons to be visible on screen.
555
+    //     timeout: 4000,
556
+    //     // Moved from interfaceConfig.TOOLBAR_ALWAYS_VISIBLE
557
+    //     // Whether toolbar should be always visible or should hide after x miliseconds.
558
+    //     alwaysVisible: false
559
+    // },
560
+
548 561
     // Toolbar buttons which have their click event exposed through the API on
549 562
     // `toolbarButtonClicked` event instead of executing the normal click routine.
550 563
     // buttonsWithNotifyClick: [

+ 13
- 3
interface_config.js Целия файл

@@ -97,7 +97,11 @@ var interfaceConfig = {
97 97
      */
98 98
     HIDE_INVITE_MORE_HEADER: false,
99 99
 
100
-    INITIAL_TOOLBAR_TIMEOUT: 20000,
100
+    /**
101
+     * DEPRECATED! Moved to config.js as `toolbarConfig.initialTimeout`.
102
+     */
103
+    // INITIAL_TOOLBAR_TIMEOUT: 20000,
104
+
101 105
     JITSI_WATERMARK_LINK: 'https://jitsi.org',
102 106
 
103 107
     LANG_DETECTION: true, // Allow i18n to detect the system language
@@ -183,7 +187,10 @@ var interfaceConfig = {
183 187
      */
184 188
     SUPPORT_URL: 'https://community.jitsi.org/',
185 189
 
186
-    TOOLBAR_ALWAYS_VISIBLE: false,
190
+    /**
191
+     * DEPRECATED! Moved to config.js as `toolbarConfig.alwaysVisible`.
192
+     */
193
+    // TOOLBAR_ALWAYS_VISIBLE: false,
187 194
 
188 195
     /**
189 196
      * DEPRECATED!
@@ -191,7 +198,10 @@ var interfaceConfig = {
191 198
      */
192 199
     // TOOLBAR_BUTTONS: [],
193 200
 
194
-    TOOLBAR_TIMEOUT: 4000,
201
+    /**
202
+     * DEPRECATED! Moved to config.js as `toolbarConfig.timeout`.
203
+     */
204
+    // TOOLBAR_TIMEOUT: 4000,
195 205
 
196 206
     // Browsers, in addition to those which do not fully support WebRTC, that
197 207
     // are not supported and should show the unsupported browser page.

+ 1
- 0
react/features/base/config/configWhitelist.js Целия файл

@@ -188,6 +188,7 @@ export default [
188 188
     'subject',
189 189
     'testing',
190 190
     'toolbarButtons',
191
+    'toolbarConfig',
191 192
     'useHostPageLocalStorage',
192 193
     'useTurnUdp',
193 194
     'videoQuality.persist',

+ 22
- 0
react/features/base/config/reducer.js Целия файл

@@ -227,6 +227,28 @@ function _translateLegacyConfig(oldValue: Object) {
227 227
         newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
228 228
     }
229 229
 
230
+    if (!oldValue.toolbarConfig) {
231
+        oldValue.toolbarConfig = {};
232
+    }
233
+
234
+    if (typeof oldValue.toolbarConfig.alwaysVisible !== 'boolean'
235
+        && typeof interfaceConfig === 'object'
236
+        && typeof interfaceConfig.TOOLBAR_ALWAYS_VISIBLE === 'boolean') {
237
+        newValue.toolbarConfig.alwaysVisible = interfaceConfig.TOOLBAR_ALWAYS_VISIBLE;
238
+    }
239
+
240
+    if (typeof oldValue.toolbarConfig.initialTimeout !== 'number'
241
+        && typeof interfaceConfig === 'object'
242
+        && typeof interfaceConfig.INITIAL_TOOLBAR_TIMEOUT === 'number') {
243
+        newValue.toolbarConfig.initialTimeout = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
244
+    }
245
+
246
+    if (typeof oldValue.toolbarConfig.timeout !== 'number'
247
+        && typeof interfaceConfig === 'object'
248
+        && typeof interfaceConfig.TOOLBAR_TIMEOUT === 'number') {
249
+        newValue.toolbarConfig.timeout = interfaceConfig.TOOLBAR_TIMEOUT;
250
+    }
251
+
230 252
     const filteredConferenceInfo = Object.keys(CONFERENCE_HEADER_MAPPING).filter(key => oldValue[key]);
231 253
 
232 254
     if (filteredConferenceInfo.length) {

+ 0
- 21
react/features/toolbox/actionTypes.js Целия файл

@@ -55,16 +55,6 @@ export const SET_OVERFLOW_MENU_VISIBLE = 'SET_OVERFLOW_MENU_VISIBLE';
55 55
  */
56 56
 export const SET_TOOLBAR_HOVERED = 'SET_TOOLBAR_HOVERED';
57 57
 
58
-/**
59
- * The type of the action which sets the permanent visibility of the Toolbox.
60
- *
61
- * {
62
- *     type: SET_TOOLBOX_ALWAYS_VISIBLE,
63
- *     alwaysVisible: boolean
64
- * }
65
- */
66
-export const SET_TOOLBOX_ALWAYS_VISIBLE = 'SET_TOOLBOX_ALWAYS_VISIBLE';
67
-
68 58
 /**
69 59
  * The type of the (redux) action which enables/disables the Toolbox.
70 60
  *
@@ -87,17 +77,6 @@ export const SET_TOOLBOX_ENABLED = 'SET_TOOLBOX_ENABLED';
87 77
  */
88 78
 export const SET_TOOLBOX_TIMEOUT = 'SET_TOOLBOX_TIMEOUT';
89 79
 
90
-/**
91
- * The type of the action which sets the delay in milliseconds after which
92
- * the Toolbox visibility is to be changed.
93
- *
94
- * {
95
- *     type: SET_TOOLBOX_TIMEOUT_MS,
96
- *     timeoutMS: number
97
- * }
98
- */
99
-export const SET_TOOLBOX_TIMEOUT_MS = 'SET_TOOLBOX_TIMEOUT_MS';
100
-
101 80
 /**
102 81
  * The type of the (redux) action which shows/hides the Toolbox.
103 82
  *

+ 14
- 24
react/features/toolbox/actions.any.js Целия файл

@@ -1,27 +1,12 @@
1 1
 // @flow
2 2
 
3
+import type { Dispatch } from 'redux';
4
+
3 5
 import {
4
-    SET_TOOLBOX_ALWAYS_VISIBLE,
5 6
     SET_TOOLBOX_ENABLED,
6 7
     SET_TOOLBOX_VISIBLE
7 8
 } from './actionTypes';
8 9
 
9
-/**
10
- * Signals that always visible toolbars value should be changed.
11
- *
12
- * @param {boolean} alwaysVisible - Value to be set in redux store.
13
- * @returns {{
14
- *     type: SET_TOOLBOX_ALWAYS_VISIBLE,
15
- *     alwaysVisible: boolean
16
- * }}
17
- */
18
-export function setToolboxAlwaysVisible(alwaysVisible: boolean): Object {
19
-    return {
20
-        type: SET_TOOLBOX_ALWAYS_VISIBLE,
21
-        alwaysVisible
22
-    };
23
-}
24
-
25 10
 /**
26 11
  * Enables/disables the toolbox.
27 12
  *
@@ -42,14 +27,19 @@ export function setToolboxEnabled(enabled: boolean): Object {
42 27
  * Shows/hides the toolbox.
43 28
  *
44 29
  * @param {boolean} visible - True to show the toolbox or false to hide it.
45
- * @returns {{
46
- *     type: SET_TOOLBOX_VISIBLE,
47
- *     visible: boolean
48
- * }}
30
+ * @returns {Function}
49 31
  */
50 32
 export function setToolboxVisible(visible: boolean): Object {
51
-    return {
52
-        type: SET_TOOLBOX_VISIBLE,
53
-        visible
33
+    return (dispatch: Dispatch<any>, getState: Function) => {
34
+        const { toolbarConfig: { alwaysVisible } } = getState()['features/base/config'];
35
+
36
+        if (!visible && alwaysVisible) {
37
+            return;
38
+        }
39
+
40
+        dispatch({
41
+            type: SET_TOOLBOX_VISIBLE,
42
+            visible
43
+        });
54 44
     };
55 45
 }

+ 15
- 5
react/features/toolbox/actions.native.js Целия файл

@@ -1,5 +1,7 @@
1 1
 // @flow
2 2
 
3
+import type { Dispatch } from 'redux';
4
+
3 5
 import { TOGGLE_TOOLBOX_VISIBLE } from './actionTypes';
4 6
 
5 7
 export * from './actions.any';
@@ -7,12 +9,20 @@ export * from './actions.any';
7 9
 /**
8 10
  * Action to toggle the toolbox visibility.
9 11
  *
10
- * @returns {{
11
- *     type: TOGGLE_TOOLBOX_VISIBLE
12
- * }}
12
+ * @returns {Function}
13 13
  */
14 14
 export function toggleToolboxVisible() {
15
-    return {
16
-        type: TOGGLE_TOOLBOX_VISIBLE
15
+    return (dispatch: Dispatch<any>, getState: Function) => {
16
+        const state = getState();
17
+        const { toolbarConfig: { alwaysVisible } } = state['features/base/config'];
18
+        const { visible } = state['features/toolbox'];
19
+
20
+        if (visible && alwaysVisible) {
21
+            return;
22
+        }
23
+
24
+        dispatch({
25
+            type: TOGGLE_TOOLBOX_VISIBLE
26
+        });
17 27
     };
18 28
 }

+ 26
- 32
react/features/toolbox/actions.web.js Целия файл

@@ -2,6 +2,7 @@
2 2
 
3 3
 import type { Dispatch } from 'redux';
4 4
 
5
+import { overwriteConfig } from '../base/config';
5 6
 import { isLayoutTileView } from '../video-layout';
6 7
 
7 8
 import {
@@ -11,12 +12,10 @@ import {
11 12
     SET_OVERFLOW_DRAWER,
12 13
     SET_OVERFLOW_MENU_VISIBLE,
13 14
     SET_TOOLBAR_HOVERED,
14
-    SET_TOOLBOX_TIMEOUT,
15
-    SET_TOOLBOX_TIMEOUT_MS
15
+    SET_TOOLBOX_TIMEOUT
16 16
 } from './actionTypes';
17
-import { setToolboxVisible } from './actions.any';
18
-
19
-declare var interfaceConfig: Object;
17
+import { setToolboxVisible } from './actions';
18
+import { getToolbarTimeout } from './functions';
20 19
 
21 20
 export * from './actions.any';
22 21
 
@@ -28,7 +27,9 @@ export * from './actions.any';
28 27
  */
29 28
 export function dockToolbox(dock: boolean): Function {
30 29
     return (dispatch: Dispatch<any>, getState: Function) => {
31
-        const { timeoutMS, visible } = getState()['features/toolbox'];
30
+        const state = getState();
31
+        const { visible } = state['features/toolbox'];
32
+        const toolbarTimeout = getToolbarTimeout(state);
32 33
 
33 34
         if (dock) {
34 35
             // First make sure the toolbox is shown.
@@ -39,7 +40,7 @@ export function dockToolbox(dock: boolean): Function {
39 40
             dispatch(
40 41
                 setToolboxTimeout(
41 42
                     () => dispatch(hideToolbox()),
42
-                    timeoutMS));
43
+                    toolbarTimeout));
43 44
         } else {
44 45
             dispatch(showToolbox());
45 46
         }
@@ -73,11 +74,9 @@ export function fullScreenChanged(fullScreen: boolean) {
73 74
 export function hideToolbox(force: boolean = false): Function {
74 75
     return (dispatch: Dispatch<any>, getState: Function) => {
75 76
         const state = getState();
76
-        const {
77
-            alwaysVisible,
78
-            hovered,
79
-            timeoutMS
80
-        } = state['features/toolbox'];
77
+        const { toolbarConfig: { alwaysVisible } } = state['features/base/config'];
78
+        const { hovered } = state['features/toolbox'];
79
+        const toolbarTimeout = getToolbarTimeout(state);
81 80
 
82 81
         if (alwaysVisible) {
83 82
             return;
@@ -95,7 +94,7 @@ export function hideToolbox(force: boolean = false): Function {
95 94
             dispatch(
96 95
                 setToolboxTimeout(
97 96
                     () => dispatch(hideToolbox()),
98
-                    timeoutMS));
97
+                    toolbarTimeout));
99 98
         } else {
100 99
             dispatch(setToolboxVisible(false));
101 100
         }
@@ -128,9 +127,13 @@ export function showToolbox(timeout: number = 0): Object {
128 127
     return (dispatch: Dispatch<any>, getState: Function) => {
129 128
         const state = getState();
130 129
         const {
131
-            alwaysVisible,
130
+            toolbarConfig: { initialTimeout, alwaysVisible },
131
+            toolbarConfig
132
+        } = state['features/base/config'];
133
+        const toolbarTimeout = getToolbarTimeout(state);
134
+
135
+        const {
132 136
             enabled,
133
-            timeoutMS,
134 137
             visible,
135 138
             overflowDrawer
136 139
         } = state['features/toolbox'];
@@ -143,11 +146,17 @@ export function showToolbox(timeout: number = 0): Object {
143 146
             // If the Toolbox is always visible, there's no need for a timeout
144 147
             // to toggle its visibility.
145 148
             if (!alwaysVisible) {
149
+                if (typeof initialTimeout === 'number') {
150
+                    // reset `initialTimeout` once it is consumed once
151
+                    dispatch(overwriteConfig({ toolbarConfig: {
152
+                        ...toolbarConfig,
153
+                        initialTimeout: null
154
+                    } }));
155
+                }
146 156
                 dispatch(
147 157
                     setToolboxTimeout(
148 158
                         () => dispatch(hideToolbox()),
149
-                        timeout || timeoutMS));
150
-                dispatch(setToolboxTimeoutMS(interfaceConfig.TOOLBAR_TIMEOUT));
159
+                        timeout || initialTimeout || toolbarTimeout));
151 160
             }
152 161
         }
153 162
     };
@@ -250,18 +259,3 @@ export function setToolboxTimeout(handler: Function, timeoutMS: number): Object
250 259
     };
251 260
 }
252 261
 
253
-/**
254
- * Dispatches an action which sets new toolbox timeout value.
255
- *
256
- * @param {number} timeoutMS - Delay.
257
- * @returns {{
258
- *     type: SET_TOOLBOX_TIMEOUT_MS,
259
- *     timeoutMS: number
260
- * }}
261
- */
262
-export function setToolboxTimeoutMS(timeoutMS: number): Object {
263
-    return {
264
-        type: SET_TOOLBOX_TIMEOUT_MS,
265
-        timeoutMS
266
-    };
267
-}

+ 2
- 0
react/features/toolbox/constants.js Целия файл

@@ -29,3 +29,5 @@ export const THRESHOLDS = [
29 29
 ];
30 30
 
31 31
 export const NOT_APPLICABLE = 'N/A';
32
+
33
+export const TOOLBAR_TIMEOUT = 4000;

+ 4
- 2
react/features/toolbox/functions.native.js Целия файл

@@ -60,12 +60,14 @@ export function getMovableButtons(width: number): Set<string> {
60 60
  */
61 61
 export function isToolboxVisible(stateful: Object | Function) {
62 62
     const state = toState(stateful);
63
-    const { alwaysVisible, enabled, visible } = state['features/toolbox'];
63
+    const { toolbarConfig: { alwaysVisible } } = state['features/base/config'];
64
+    const { enabled, visible } = state['features/toolbox'];
64 65
     const participantCount = getParticipantCountWithFake(state);
65 66
     const alwaysVisibleFlag = getFeatureFlag(state, TOOLBOX_ALWAYS_VISIBLE, false);
66 67
     const enabledFlag = getFeatureFlag(state, TOOLBOX_ENABLED, true);
67 68
 
68
-    return enabledFlag && enabled && (alwaysVisible || visible || participantCount === 1 || alwaysVisibleFlag);
69
+    return enabledFlag && enabled
70
+        && (alwaysVisible || visible || participantCount === 1 || alwaysVisibleFlag);
69 71
 }
70 72
 
71 73
 /**

+ 15
- 2
react/features/toolbox/functions.web.js Целия файл

@@ -3,6 +3,8 @@
3 3
 import { getToolbarButtons } from '../base/config';
4 4
 import { hasAvailableDevices } from '../base/devices';
5 5
 
6
+import { TOOLBAR_TIMEOUT } from './constants';
7
+
6 8
 /**
7 9
  * Helper for getting the height of the toolbox.
8 10
  *
@@ -37,9 +39,8 @@ export function isButtonEnabled(name: string, state: Object) {
37 39
  * otherwise.
38 40
  */
39 41
 export function isToolboxVisible(state: Object) {
40
-    const { iAmSipGateway } = state['features/base/config'];
42
+    const { iAmSipGateway, toolbarConfig: { alwaysVisible } } = state['features/base/config'];
41 43
     const {
42
-        alwaysVisible,
43 44
         timeoutID,
44 45
         visible
45 46
     } = state['features/toolbox'];
@@ -101,3 +102,15 @@ export function showOverflowDrawer(state: Object) {
101 102
 export function isToolboxEnabled(state: Object) {
102 103
     return state['features/toolbox'].enabled;
103 104
 }
105
+
106
+/**
107
+ * Returns the toolbar timeout from config or the default value.
108
+ *
109
+ * @param {Object} state - The state from the Redux store.
110
+ * @returns {number} - Toolbar timeout in miliseconds.
111
+ */
112
+export function getToolbarTimeout(state: Object) {
113
+    const { toolbarConfig: { timeout } } = state['features/base/config'];
114
+
115
+    return timeout || TOOLBAR_TIMEOUT;
116
+}

+ 52
- 121
react/features/toolbox/reducer.js Целия файл

@@ -8,121 +8,66 @@ import {
8 8
     SET_OVERFLOW_DRAWER,
9 9
     SET_OVERFLOW_MENU_VISIBLE,
10 10
     SET_TOOLBAR_HOVERED,
11
-    SET_TOOLBOX_ALWAYS_VISIBLE,
12 11
     SET_TOOLBOX_ENABLED,
13 12
     SET_TOOLBOX_TIMEOUT,
14
-    SET_TOOLBOX_TIMEOUT_MS,
15 13
     SET_TOOLBOX_VISIBLE,
16 14
     TOGGLE_TOOLBOX_VISIBLE
17 15
 } from './actionTypes';
18 16
 
19
-declare var interfaceConfig: Object;
20
-
21 17
 /**
22
- * Returns initial state for toolbox's part of Redux store.
23
- *
24
- * @private
25
- * @returns {{
26
- *     alwaysVisible: boolean,
27
- *     enabled: boolean,
28
- *     hovered: boolean,
29
- *     overflowDrawer: boolean,
30
- *     overflowMenuVisible: boolean,
31
- *     timeoutID: number,
32
- *     timeoutMS: number,
33
- *     visible: boolean
34
- * }}
18
+ * Initial state of toolbox's part of Redux store.
35 19
  */
36
-function _getInitialState() {
37
-    // Does the toolbar eventually fade out, or is it always visible?
38
-    let alwaysVisible = false;
39
-
40
-    // Toolbar (initial) visibility.
41
-    let visible = false;
42
-
43
-    // Default toolbox timeout for mobile app.
44
-    let timeoutMS = 5000;
45
-
46
-    if (typeof interfaceConfig !== 'undefined') {
47
-        if (interfaceConfig.INITIAL_TOOLBAR_TIMEOUT) {
48
-            timeoutMS = interfaceConfig.INITIAL_TOOLBAR_TIMEOUT;
49
-        }
50
-        if (typeof interfaceConfig.TOOLBAR_ALWAYS_VISIBLE !== 'undefined') {
51
-            alwaysVisible = interfaceConfig.TOOLBAR_ALWAYS_VISIBLE;
52
-        }
53
-    }
54
-
55
-    // When the toolbar is always visible, it must initially be visible too.
56
-    if (alwaysVisible === true) {
57
-        visible = true;
58
-    }
59
-
60
-    return {
61
-        /**
62
-         * The indicator which determines whether the Toolbox should always be
63
-         * visible. When false, the toolbar will fade out after timeoutMS.
64
-         *
65
-         * @type {boolean}
66
-         */
67
-        alwaysVisible,
68
-
69
-        /**
70
-         * The indicator which determines whether the Toolbox is enabled.
71
-         *
72
-         * @type {boolean}
73
-         */
74
-        enabled: true,
75
-
76
-        /**
77
-         * The indicator which determines whether a Toolbar in the Toolbox is
78
-         * hovered.
79
-         *
80
-         * @type {boolean}
81
-         */
82
-        hovered: false,
83
-
84
-        /**
85
-         * The indicator which determines whether the overflow menu(s) are to be displayed as drawers.
86
-         *
87
-         * @type {boolean}
88
-         */
89
-        overflowDrawer: false,
90
-
91
-        /**
92
-         * The indicator which determines whether the OverflowMenu is visible.
93
-         *
94
-         * @type {boolean}
95
-         */
96
-        overflowMenuVisible: false,
97
-
98
-        /**
99
-         * A number, non-zero value which identifies the timer created by a call
100
-         * to setTimeout() with timeoutMS.
101
-         *
102
-         * @type {number|null}
103
-         */
104
-        timeoutID: null,
105
-
106
-        /**
107
-         * The delay in milliseconds before timeoutID executes (after its
108
-         * initialization).
109
-         *
110
-         * @type {number}
111
-         */
112
-        timeoutMS,
113
-
114
-        /**
115
-         * The indicator that determines whether the Toolbox is visible.
116
-         *
117
-         * @type {boolean}
118
-         */
119
-        visible
120
-    };
121
-}
20
+const INITIAL_STATE = {
21
+
22
+    /**
23
+     * The indicator which determines whether the Toolbox is enabled.
24
+     *
25
+     * @type {boolean}
26
+     */
27
+    enabled: true,
28
+
29
+    /**
30
+     * The indicator which determines whether a Toolbar in the Toolbox is
31
+     * hovered.
32
+     *
33
+     * @type {boolean}
34
+     */
35
+    hovered: false,
36
+
37
+    /**
38
+     * The indicator which determines whether the overflow menu(s) are to be displayed as drawers.
39
+     *
40
+     * @type {boolean}
41
+     */
42
+    overflowDrawer: false,
43
+
44
+    /**
45
+     * The indicator which determines whether the OverflowMenu is visible.
46
+     *
47
+     * @type {boolean}
48
+     */
49
+    overflowMenuVisible: false,
50
+
51
+    /**
52
+     * A number, non-zero value which identifies the timer created by a call
53
+     * to setTimeout().
54
+     *
55
+     * @type {number|null}
56
+     */
57
+    timeoutID: null,
58
+
59
+
60
+    /**
61
+     * The indicator that determines whether the Toolbox is visible.
62
+     *
63
+     * @type {boolean}
64
+     */
65
+    visible: false
66
+};
122 67
 
123 68
 ReducerRegistry.register(
124 69
     'features/toolbox',
125
-    (state: Object = _getInitialState(), action: Object) => {
70
+    (state: Object = INITIAL_STATE, action: Object) => {
126 71
         switch (action.type) {
127 72
         case CLEAR_TOOLBOX_TIMEOUT:
128 73
             return {
@@ -154,13 +99,6 @@ ReducerRegistry.register(
154 99
                 hovered: action.hovered
155 100
             };
156 101
 
157
-        case SET_TOOLBOX_ALWAYS_VISIBLE:
158
-            return {
159
-                ...state,
160
-                alwaysVisible: action.alwaysVisible,
161
-                visible: action.alwaysVisible === true ? true : state.visible
162
-            };
163
-
164 102
         case SET_TOOLBOX_ENABLED:
165 103
             return {
166 104
                 ...state,
@@ -170,21 +108,14 @@ ReducerRegistry.register(
170 108
         case SET_TOOLBOX_TIMEOUT:
171 109
             return {
172 110
                 ...state,
173
-                timeoutID: action.timeoutID,
174
-                timeoutMS: action.timeoutMS
175
-            };
176
-
177
-        case SET_TOOLBOX_TIMEOUT_MS:
178
-            return {
179
-                ...state,
180
-                timeoutMS: action.timeoutMS
111
+                timeoutID: action.timeoutID
181 112
             };
182 113
 
183 114
         case SET_TOOLBOX_VISIBLE:
184
-            return set(state, 'visible', state.alwaysVisible || action.visible);
115
+            return set(state, 'visible', action.visible);
185 116
 
186 117
         case TOGGLE_TOOLBOX_VISIBLE:
187
-            return set(state, 'visible', state.alwaysVisible || !state.visible);
118
+            return set(state, 'visible', !state.visible);
188 119
         }
189 120
 
190 121
         return state;

Loading…
Отказ
Запис