flicker issue
This commit is contained in:
@@ -393,6 +393,8 @@ function App() {
|
||||
.catch(() => setBackendHealthy(false));
|
||||
}, []);
|
||||
|
||||
const hasImportedRemoteRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
try {
|
||||
@@ -403,7 +405,8 @@ function App() {
|
||||
const token = params.get('token');
|
||||
const resourceId = params.get('resource_id');
|
||||
|
||||
if (streamUrl && uploadUrl && token) {
|
||||
if (streamUrl && uploadUrl && token && !hasImportedRemoteRef.current) {
|
||||
hasImportedRemoteRef.current = true;
|
||||
try {
|
||||
const gatewayUrl = import.meta.env.VITE_GATEWAY_URL || '';
|
||||
const res = await fetch(`${gatewayUrl}/documents/import-remote`, {
|
||||
|
||||
@@ -66,7 +66,7 @@ export const CanvasLayer: React.FC<CanvasLayerProps> = ({
|
||||
};
|
||||
img.src = imageUrl;
|
||||
|
||||
}, [imageUrl, zoom, rotation, width, height, onRenderComplete, vectorOps]);
|
||||
}, [imageUrl, zoom, rotation, width, height, onRenderComplete]);
|
||||
|
||||
return (
|
||||
<canvas
|
||||
|
||||
Reference in New Issue
Block a user