fix(tile-view): disable on etherpad display, disable etherpad on view enter
This commit is contained in:
parent
29bc18df01
commit
1396d59ce2
|
@ -4,6 +4,7 @@ import {
|
||||||
pinParticipant
|
pinParticipant
|
||||||
} from '../base/participants';
|
} from '../base/participants';
|
||||||
import { MiddlewareRegistry } from '../base/redux';
|
import { MiddlewareRegistry } from '../base/redux';
|
||||||
|
import { SET_DOCUMENT_EDITING_STATUS, toggleDocument } from '../etherpad';
|
||||||
|
|
||||||
import { SET_TILE_VIEW } from './actionTypes';
|
import { SET_TILE_VIEW } from './actionTypes';
|
||||||
import { setTileView } from './actions';
|
import { setTileView } from './actions';
|
||||||
|
@ -27,13 +28,29 @@ MiddlewareRegistry.register(store => next => action => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SET_TILE_VIEW:
|
case SET_DOCUMENT_EDITING_STATUS:
|
||||||
if (getPinnedParticipant(store.getState()) && action.enabled) {
|
if (action.editing) {
|
||||||
store.dispatch(pinParticipant(null));
|
store.dispatch(setTileView(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SET_TILE_VIEW: {
|
||||||
|
const state = store.getState();
|
||||||
|
|
||||||
|
if (action.enabled) {
|
||||||
|
if (getPinnedParticipant(state)) {
|
||||||
|
store.dispatch(pinParticipant(null));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state['features/etherpad'].editing) {
|
||||||
|
store.dispatch(toggleDocument());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return next(action);
|
return next(action);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue