Fix resizing

This commit is contained in:
Jacob Karlsson 2024-05-23 13:25:21 +02:00
parent 992eb762d6
commit 618d7298e1
3 changed files with 12 additions and 12 deletions

View File

@ -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",

View File

@ -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

View File

@ -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 (
<div className="flex flex-row items-stretch h-screen text-slate-900">