Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: don't bump element version when adding files data (#4794)

David Luzar5c61613a2e22
diff --git a/src/components/App.tsx b/src/components/App.tsx
index a524bd5e34..ae5376fa68 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -115,11 +115,7 @@ import {
updateBoundElements,
} from "../element/binding";
import { LinearElementEditor } from "../element/linearElementEditor";
-import {
- bumpVersion,
- mutateElement,
- newElementWith,
-} from "../element/mutateElement";
+import { mutateElement, newElementWith } from "../element/mutateElement";
import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
import {
hasBoundTextElement,
@@ -1620,9 +1616,6 @@ class App extends React.Component<AppProps, AppState> {
this.files = { ...this.files, ...Object.fromEntries(filesMap) };
- // bump versions for elements that reference added files so that
- // we/host apps can detect the change, and invalidate the image & shape
- // cache
this.scene.getElements().forEach((element) => {
if (
isInitializedImageElement(element) &&
@@ -1630,7 +1623,6 @@ class App extends React.Component<AppProps, AppState> {
) {
this.imageCache.delete(element.fileId);
invalidateShapeForElement(element);
- bumpVersion(element);
}
});
this.scene.informMutation();