flicker issue

This commit is contained in:
momorew
2026-08-23 16:02:58 +05:30
parent 9e80489254
commit 7cfbac1a07
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -393,6 +393,8 @@ function App() {
.catch(() => setBackendHealthy(false)); .catch(() => setBackendHealthy(false));
}, []); }, []);
const hasImportedRemoteRef = useRef(false);
useEffect(() => { useEffect(() => {
(async () => { (async () => {
try { try {
@@ -403,7 +405,8 @@ function App() {
const token = params.get('token'); const token = params.get('token');
const resourceId = params.get('resource_id'); const resourceId = params.get('resource_id');
if (streamUrl && uploadUrl && token) { if (streamUrl && uploadUrl && token && !hasImportedRemoteRef.current) {
hasImportedRemoteRef.current = true;
try { try {
const gatewayUrl = import.meta.env.VITE_GATEWAY_URL || ''; const gatewayUrl = import.meta.env.VITE_GATEWAY_URL || '';
const res = await fetch(`${gatewayUrl}/documents/import-remote`, { const res = await fetch(`${gatewayUrl}/documents/import-remote`, {
+1 -1
View File
@@ -66,7 +66,7 @@ export const CanvasLayer: React.FC<CanvasLayerProps> = ({
}; };
img.src = imageUrl; img.src = imageUrl;
}, [imageUrl, zoom, rotation, width, height, onRenderComplete, vectorOps]); }, [imageUrl, zoom, rotation, width, height, onRenderComplete]);
return ( return (
<canvas <canvas