mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-11 16:24:38 +01:00
Update App.tsx
This commit is contained in:
@@ -2367,9 +2367,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
private clearImageShapeCache() {
|
private clearImageShapeCache(filesMap?: BinaryFiles) {
|
||||||
|
const files = filesMap ?? this.files;
|
||||||
this.scene.getNonDeletedElements().forEach((element) => {
|
this.scene.getNonDeletedElements().forEach((element) => {
|
||||||
if (isInitializedImageElement(element) && this.files[element.fileId]) {
|
if (isInitializedImageElement(element) && files[element.fileId]) {
|
||||||
this.imageCache.delete(element.fileId);
|
this.imageCache.delete(element.fileId);
|
||||||
ShapeCache.delete(element);
|
ShapeCache.delete(element);
|
||||||
}
|
}
|
||||||
@@ -3690,7 +3691,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
|
|
||||||
this.files = { ...this.files, ...Object.fromEntries(filesMap) };
|
this.files = { ...this.files, ...Object.fromEntries(filesMap) };
|
||||||
|
|
||||||
this.clearImageShapeCache();
|
this.clearImageShapeCache(Object.fromEntries(filesMap));
|
||||||
this.scene.triggerUpdate();
|
this.scene.triggerUpdate();
|
||||||
|
|
||||||
this.addNewImagesToImageCache();
|
this.addNewImagesToImageCache();
|
||||||
|
|||||||
Reference in New Issue
Block a user