Skip to content
Snippets Groups Projects
Commit 855053ec authored by chris's avatar chris
Browse files

active box fix

parent d3f74982
No related branches found
No related tags found
1 merge request!258Editoria fixes
......@@ -17,6 +17,7 @@ const ConnectedCommentStyled = styled.div`
`;
export default ({ comment, top, commentId, recalculateTops }) => {
const context = useContext(WaxContext);
const {
view,
view: {
......@@ -26,7 +27,7 @@ export default ({ comment, top, commentId, recalculateTops }) => {
},
app,
activeView,
} = useContext(WaxContext);
} = context;
const [isActive, setIsActive] = useState(false);
const [clickPost, setClickPost] = useState(false);
......@@ -93,6 +94,8 @@ export default ({ comment, top, commentId, recalculateTops }) => {
return false;
}
if (viewId !== 'main') context.updateView({}, viewId);
const maxPos = maxBy(allCommentsWithSameId, 'pos');
maxPos.pos += last(allCommentsWithSameId).node.nodeSize;
......
......@@ -19,7 +19,8 @@ const ConnectedTrackChangeStyled = styled.div`
`;
export default ({ trackChangeId, top, recalculateTops, trackChange }) => {
const { app, activeView, view } = useContext(WaxContext);
const context = useContext(WaxContext);
const { app, activeView, view } = context;
const user = app.config.get('user');
const [isActive, setIsActive] = useState(false);
const { state, dispatch } = activeView;
......@@ -37,6 +38,8 @@ export default ({ trackChangeId, top, recalculateTops, trackChange }) => {
const onClickBox = trackData => {
if (trackData.node) return focusOnBlcock(trackData);
if (viewId !== 'main') context.updateView({}, viewId);
const allTracksWithSameId = DocumentHelpers.findAllMarksWithSameId(
view[viewId].state,
trackData,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment