Skip to content

Commit

Permalink
0.17.6-14
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Nov 10, 2024
1 parent e5b508d commit 6e46a5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
33 changes: 3 additions & 30 deletions packages/excalidraw/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4007,7 +4007,7 @@ class App extends React.Component<AppProps, AppState> {
* */
public addFiles: ExcalidrawImperativeAPI["addFiles"] = withBatchedUpdates(
(files) => {
const { addedFiles } = this.addMissingFiles(files, true); //zsviczian
const { addedFiles } = this.addMissingFiles(files, undefined, true); //zsviczian

this.clearImageShapeCache(addedFiles);
this.scene.triggerUpdate();
Expand Down Expand Up @@ -4119,14 +4119,15 @@ class App extends React.Component<AppProps, AppState> {
private addMissingFiles = (
files: BinaryFiles | BinaryFileData[],
replace = false,
force = false, //zsviczian
) => {
const nextFiles = replace ? {} : { ...this.files };
const addedFiles: BinaryFiles = {};

const _files = Array.isArray(files) ? files : Object.values(files);

for (const fileData of _files) {
if (nextFiles[fileData.id]) {
if (!force && nextFiles[fileData.id]) { //zsviczian
continue;
}

Expand Down Expand Up @@ -11317,32 +11318,4 @@ declare global {
}
}

/* //zsviczian
export const createTestHook = () => {
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
window.h = window.h || ({} as Window["h"]);
Object.defineProperties(window.h, {
elements: {
configurable: true,
get() {
return this.app?.scene.getElementsIncludingDeleted();
},
set(elements: ExcalidrawElement[]) {
return this.app?.scene.replaceAllElements(
syncInvalidIndices(elements),
);
},
},
scene: {
configurable: true,
get() {
return this.app?.scene;
},
},
});
}
};
createTestHook();*/
export default App;
2 changes: 1 addition & 1 deletion packages/excalidraw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zsviczian/excalidraw",
"version": "0.17.6-13",
"version": "0.17.6-14",
"main": "main.js",
"types": "types/excalidraw/index.d.ts",
"files": [
Expand Down

0 comments on commit 6e46a5d

Please sign in to comment.