Skip to content

Commit 4e70d61

Browse files
authored
Merge branch 'dev' into glueball-nix
2 parents 7eb1768 + 64a4fb4 commit 4e70d61

4 files changed

Lines changed: 28 additions & 18 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8+
- package-ecosystem: "nix"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

fission/public/assetpack.zip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:929579b2dc87cffb6b5236f054a6b1ffcb17f0a384f4262f58fd2cb99fdc48ac
3-
size 41776301
2+
oid sha256:2213eb7905d6fe15beb5fca656065c248da0c4f4b7630ced943bb5cf4a32c3fb
3+
size 43082276

fission/src/ui/UIProvider.tsx

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import CloseIcon from "@mui/icons-material/Close"
22
import type { SnackbarKey, SnackbarMessage, VariantType } from "notistack"
33
import { useSnackbar } from "notistack"
44
import type React from "react"
5+
import { useRef } from "react"
56
import { useMemo } from "react"
67
import type { FunctionComponent, ReactNode } from "react"
78
import { Fragment, useCallback, useReducer, useState } from "react"
@@ -120,6 +121,9 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
120121
}
121122
}, [refreshDep, panels])
122123

124+
const blockStateRef = useRef<UIBlockState>(blockState)
125+
blockStateRef.current = blockState
126+
123127
const openModal: OpenModalFn = useCallback(
124128
<T, P>(
125129
content: FunctionComponent<ModalImplProps<T, P>>,
@@ -128,8 +132,8 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
128132
props: Omit<ModalProps<P>, "type" | "configured" | "custom"> &
129133
Omit<UIScreenCallbacks<T>, "onBeforeAccept"> = DEFAULT_PROPS
130134
) => {
131-
if (blockState.blocked) {
132-
addToast("warning", blockState.blockMessage)
135+
if (blockStateRef.current.blocked) {
136+
addToast("warning", blockStateRef.current.blockMessage)
133137
return null
134138
}
135139

@@ -163,7 +167,7 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
163167
setModal(newModal as Modal<any, any>)
164168
return id
165169
},
166-
[modal, blockState]
170+
[modal]
167171
)
168172

169173
const snackbarAction = useCallback(
@@ -215,8 +219,8 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
215219
}
216220

217221
// if any (generic) open panel declares itself as blocking, prevent opening a new one
218-
if (blockState.blocked) {
219-
addToast("warning", blockState.blockMessage)
222+
if (blockStateRef.current.blocked) {
223+
addToast("warning", blockStateRef.current.blockMessage)
220224
return null
221225
}
222226

@@ -252,7 +256,7 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
252256
})
253257
return id
254258
},
255-
[panels, addToast, blockState]
259+
[panels, addToast]
256260
)
257261

258262
const closeModal = useCallback(
@@ -309,15 +313,18 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
309313
if ("exclusiveGroup" in screen.props) {
310314
const exclusiveGroup = screen.props.exclusiveGroup
311315
if (exclusiveGroup != null) {
312-
const existing = panels.find(p => p.props.exclusiveGroup == exclusiveGroup && p !== screen)
313-
if (existing) {
314-
closePanel(existing.id, CloseType.OVERWRITE)
315-
}
316+
setPanels(panels => {
317+
const existing = panels.find(p => p.props.exclusiveGroup == exclusiveGroup && p !== screen)
318+
if (existing) {
319+
closePanel(existing.id, CloseType.OVERWRITE)
320+
}
321+
return panels
322+
})
316323
}
317324
}
318325
refresh()
319326
},
320-
[closePanel, panels]
327+
[closePanel]
321328
)
322329

323330
return (

fission/src/ui/panels/configuring/assembly-config/ConfigurePanel.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ const ConfigurePanel: React.FC<PanelImplProps<void, ConfigurePanelCustomProps>>
341341
pendingDeletes={pendingDeletes}
342342
/>
343343

344-
{configMode === undefined &&
345-
selectedAssembly !== undefined &&
344+
{selectedAssembly !== undefined &&
346345
(!selectedAssembly.isOwnObject ? (
347346
<Label size={"sm"}>Cannot configure someone else's object</Label>
348347
) : (
@@ -360,13 +359,13 @@ const ConfigurePanel: React.FC<PanelImplProps<void, ConfigurePanelCustomProps>>
360359
{ConfigSubPanel != null && (
361360
<ConfigSubPanel
362361
panel={panel!}
363-
selectedAssembly={selectedAssembly!}
362+
selectedAssembly={selectedAssembly}
364363
setDisableAccept={setDisableAccept}
365364
hasMadeChanges={hasMadeChanges}
366365
registerCleanupFunction={registerCleanupFunctions}
367366
/>
368367
)}
369-
{
368+
{configMode === undefined && (
370369
<>
371370
<Spacer height={16} />
372371
<AssemblyExportButton selectedAssembly={selectedAssembly} />
@@ -388,7 +387,7 @@ const ConfigurePanel: React.FC<PanelImplProps<void, ConfigurePanelCustomProps>>
388387
<FaArrowsRotate />
389388
</Button>
390389
</>
391-
}
390+
)}
392391
</>
393392
))}
394393
</>

0 commit comments

Comments
 (0)