From 618d7298e17523ffd30da89dd9fbd4dceb8aaec4 Mon Sep 17 00:00:00 2001 From: Jacob Karlsson Date: Thu, 23 May 2024 13:25:21 +0200 Subject: [PATCH] Fix resizing --- package.json | 6 +++--- pnpm-lock.yaml | 8 ++++---- src/App.js | 10 +++++----- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 9e26fd0..d2e478e 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,12 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "electron": "ELECTRON_START_URL=http://localhost:3001 DEBUG=*,-shse,-pull-secretstream electron .", - "electron2": "ZOOBOARD_DATA=/tmp/zooboard-test ELECTRON_START_URL=http://localhost:3002 DEBUG=*,-shse,-pull-secretstream electron .", + "electron": "ELECTRON_START_URL=http://localhost:3001 electron .", + "electron2": "ZOOBOARD_DATA=/tmp/zooboard-test ELECTRON_START_URL=http://localhost:3002 electron .", "start-all": "concurrently --kill-others \"npm start\" \"./scripts/wait.sh 3001 && npm run electron\" \"npm run start2\" \"./scripts/wait.sh 3002 && npm run electron2\"" }, "dependencies": { - "@excalidraw/excalidraw": "0.17.2", + "@excalidraw/excalidraw": "0.17.6", "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd02dbe..f8217a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2,8 +2,8 @@ lockfileVersion: '6.0' dependencies: '@excalidraw/excalidraw': - specifier: 0.17.2 - version: 0.17.2(react-dom@18.2.0)(react@18.2.0) + specifier: 0.17.6 + version: 0.17.6(react-dom@18.2.0)(react@18.2.0) '@testing-library/jest-dom': specifier: ^5.17.0 version: 5.17.0 @@ -1794,8 +1794,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: false - /@excalidraw/excalidraw@0.17.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-7pqUWD8+mPjDhF4XxG3gw4rvE2JGaLW3Vss5UZfTbITPxAtFaGEc1K081bncitnaYhUwN9ENJE0i87QB3poDwQ==} + /@excalidraw/excalidraw@0.17.6(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-fyCl+zG/Z5yhHDh5Fq2ZGmphcrALmuOdtITm8gN4d8w4ntnaopTXcTfnAAaU3VleDC6LhTkoLOTG6P5kgREiIg==} peerDependencies: react: ^17.0.2 || ^18.2.0 react-dom: ^17.0.2 || ^18.2.0 diff --git a/src/App.js b/src/App.js index 1ab0e0b..7c2c012 100644 --- a/src/App.js +++ b/src/App.js @@ -1,6 +1,6 @@ import { useState } from 'react' import { Excalidraw } from '@excalidraw/excalidraw' -import debounce from 'debounce' +//import debounce from 'debounce' import MyAccount from './MyAccount' import Connections from './Connections' import Button from './Button' @@ -34,10 +34,10 @@ function App() { if (elem.isDeleted) { elemsPersisted.delete(elem.id) } else { - elemsPersisted.set(elem.id, elem) + elemsPersisted.set(elem.id, { ...elem }) } } - api.updateScene({ elements: [...elemsPersisted.values()] }) + api.updateScene({ elements: [...elemsPersisted.values()].map(v=>({...v})) }) if (!sceneInitialized) sceneInitialized = true }) } @@ -58,7 +58,7 @@ function App() { openJoinModal() } - const updateElements = debounce((elems) => { + const updateElements = (elems) => { if (!sceneInitialized) return const actions = [] for (const elem of elems) { @@ -71,7 +71,7 @@ function App() { if (actions.length > 0) { window.electronAPI.writeElements(actions) } - }, 100) + } return (