|
|
@@ -4,6 +4,7 @@ import {
|
|
4
|
4
|
pinParticipant
|
|
5
|
5
|
} from '../base/participants';
|
|
6
|
6
|
import { MiddlewareRegistry } from '../base/redux';
|
|
|
7
|
+import { SET_DOCUMENT_EDITING_STATUS, toggleDocument } from '../etherpad';
|
|
7
|
8
|
|
|
8
|
9
|
import { SET_TILE_VIEW } from './actionTypes';
|
|
9
|
10
|
import { setTileView } from './actions';
|
|
|
@@ -27,13 +28,29 @@ MiddlewareRegistry.register(store => next => action => {
|
|
27
|
28
|
break;
|
|
28
|
29
|
}
|
|
29
|
30
|
|
|
30
|
|
- case SET_TILE_VIEW:
|
|
31
|
|
- if (getPinnedParticipant(store.getState()) && action.enabled) {
|
|
32
|
|
- store.dispatch(pinParticipant(null));
|
|
|
31
|
+ case SET_DOCUMENT_EDITING_STATUS:
|
|
|
32
|
+ if (action.editing) {
|
|
|
33
|
+ store.dispatch(setTileView(false));
|
|
|
34
|
+ }
|
|
|
35
|
+
|
|
|
36
|
+ break;
|
|
|
37
|
+
|
|
|
38
|
+ case SET_TILE_VIEW: {
|
|
|
39
|
+ const state = store.getState();
|
|
|
40
|
+
|
|
|
41
|
+ if (action.enabled) {
|
|
|
42
|
+ if (getPinnedParticipant(state)) {
|
|
|
43
|
+ store.dispatch(pinParticipant(null));
|
|
|
44
|
+ }
|
|
|
45
|
+
|
|
|
46
|
+ if (state['features/etherpad'].editing) {
|
|
|
47
|
+ store.dispatch(toggleDocument());
|
|
|
48
|
+ }
|
|
33
|
49
|
}
|
|
34
|
50
|
|
|
35
|
51
|
break;
|
|
36
|
52
|
}
|
|
|
53
|
+ }
|
|
37
|
54
|
|
|
38
|
55
|
return next(action);
|
|
39
|
56
|
});
|