flicker issue
This commit is contained in:
@@ -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`, {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user