Skip to content

Commit

Permalink
Release 2.0.107-b8
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Feb 14, 2025
1 parent e48a522 commit dd2c088
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ledfx",
"version": "2.0.107-b7",
"version": "2.0.107-b8",
"description": "LedFx v2 - BladeMOD!",
"author": "YeonV aka Blade",
"private": true,
Expand Down
31 changes: 9 additions & 22 deletions src/components/Dialogs/AddVirtualDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ const AddVirtualDialog = () => {

if (!valid) {
showSnackbar('warning', 'Please fill in all required fields.')
} else if (
initial.config &&
Object.keys(initial.config).length === 0 &&
initial.config?.constructor === Object
) {
} else if (addNew) {
// console.log("ADDING");
addVirtual({
config: { ...defaultModel, ...cleanedModel }
Expand Down Expand Up @@ -116,6 +112,11 @@ const AddVirtualDialog = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [virtId, JSON.stringify(initial.config)])

const addNew =
initial.config &&
Object.keys(initial.config).length === 0 &&
initial.config?.constructor === Object

return (
<>
<Dialog
Expand All @@ -124,11 +125,7 @@ const AddVirtualDialog = () => {
aria-labelledby="form-dialog-title"
>
<DialogTitle id="form-dialog-title">
{initial.config &&
Object.keys(initial.config).length === 0 &&
initial.config?.constructor === Object
? 'Add Virtual Device'
: 'Settings'}
{addNew ? 'Add Virtual Device' : 'Settings'}
</DialogTitle>
<DialogContent>
<DialogContentText component="div">
Expand Down Expand Up @@ -157,13 +154,7 @@ const AddVirtualDialog = () => {

<BladeSchemaForm
schema={currentSchema}
model={
initial.config &&
Object.keys(initial.config).length === 0 &&
initial.config?.constructor === Object
? model
: { ...initial.config, ...model }
}
model={addNew ? model : { ...initial.config, ...model }}
onModelChange={handleModelChange}
/>
</DialogContent>
Expand All @@ -172,11 +163,7 @@ const AddVirtualDialog = () => {
Cancel
</Button>
<Button onClick={handleAddVirtual} color="primary">
{initial.config &&
Object.keys(initial.config).length === 0 &&
initial.config?.constructor === Object
? 'Add & Setup Segments'
: 'Save'}
{addNew ? 'Add & Setup Segments' : 'Save'}
</Button>
</DialogActions>
</Dialog>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PixelGraph/PixelGraphCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const PixelGraphCanvas = ({
className={`${className} ${active ? 'active' : ''}`}
style={{
maxWidth: fullScreen ? '100vw' : '520px',
maxHeight: fullScreen ? '100vh' : '380px',
maxHeight: fullScreen ? '100vh' : '520px',
height:
!render || virtuals[virtId]?.config?.rows < 2 || !showMatrix
? '20px'
Expand Down

0 comments on commit dd2c088

Please sign in to comment.