Aykut Saraç 2 лет назад
Родитель
Сommit
c76da1fb22
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/components/Graph/index.tsx

+ 2 - 2
src/components/Graph/index.tsx

@@ -92,12 +92,12 @@ const GraphComponent = ({
         requestAnimationFrame(() => {
           setTimeout(() => {
             setLoading(false);
-            setTimeout(() => changeRatio > 100 && centerView(), 0);
+            setTimeout(() => (changeRatio > 100 || isWidget) && centerView(), 0);
           }, 0);
         });
       }
     },
-    [centerView, setLoading, size.height, size.width]
+    [centerView, isWidget, setLoading, size.height, size.width]
   );
 
   const onCanvasClick = React.useCallback(() => {