mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Update App.tsx
This commit is contained in:
parent
72b7c937b1
commit
b46ca0192b
1 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue