fix: admin/internet: console error after clicking cancel in router's port configuration dialog
Massimo Melina committed
Sep 28, 2024 at 14:44 UTC
7e269a2c88a9609e30b37a528944e89015542f9e
1 file changed
+1
-1
shared/dialogs.ts
+1
-1
@@ -225,7 +225,7 @@ export function closeDialog(v?:any, skipHistory=false) {
225
function closeDialogAt(i: number, value?: any) {
226
const [d] = dialogs.splice(i,1)
227
d.restoreFocus?.focus?.() // if element is not HTMLElement, it doesn't have focus method
228
- d.closingValue = value
228
+ d.closingValue = value && typeof value === 'object' ? ref(value) : value // since this is being assigned to a valtio proxy, ref is necessary to avoid crashing with unusual (and possibly accidental) objects like React's SynteticEvents
229
Promise.resolve(d.closed).then(() =>
230
d?.onClose?.(value))
231
return d