Skip to content
Snippets Groups Projects
Commit 25793f92 authored by chris's avatar chris
Browse files

delay rendering boxes tops on first run

parent 9f7b1630
No related branches found
No related tags found
1 merge request!143Track changes
......@@ -21,6 +21,7 @@ export default ({ area }) => {
const commentPlugin = app.PmPlugins.get('commentPlugin');
const [marksNodes, setMarksNodes] = useState([]);
const [position, setPosition] = useState();
const [isFirstRun, setFirstRun] = useState(true);
const setTops = useCallback(() => {
const result = [];
......@@ -125,9 +126,14 @@ export default ({ area }) => {
useEffect(() => {
setMarksNodes(updateMarks(view));
setTimeout(() => {
if (isFirstRun) {
setTimeout(() => {
setPosition(setTops());
setFirstRun(false);
}, 400);
} else {
setPosition(setTops());
});
}
}, [JSON.stringify(updateMarks(view)), JSON.stringify(setTops())]);
const CommentTrackComponent = useMemo(
......
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