fix: close create dialog before showing config dialog
All checks were successful
CI / test (push) Successful in 1m44s
CI / release (push) Successful in 30s
CI / docker (push) Successful in 49s

The config dialog was being created inside the create dialog's slot
context. When NiceGUI tried to attach the new dialog, the parent
slot was already marked for deletion, causing a RuntimeError.
This commit is contained in:
Stefano Bertelli 2026-03-30 22:13:11 -05:00
parent 2eb35e94e9
commit 3d1ca7444b
2 changed files with 2 additions and 2 deletions

View file

@ -128,11 +128,11 @@ async def admin_devices_page():
# Show config
server_pubkey = await get_server_public_key()
config_text = build_client_config(device, private_key, server_pubkey)
_show_config_dialog(device.name, config_text)
create_dialog.close()
_reset_create_form()
await refresh_table()
_show_config_dialog(device.name, config_text)
except Exception as e:
logger.error("Failed to create device: {}", e)
ui.notify(f"Error: {e}", type="negative")

View file

@ -112,11 +112,11 @@ async def devices_page():
server_pubkey = await get_server_public_key()
config_text = build_client_config(device, private_key, server_pubkey)
_show_config_dialog(device.name, config_text)
create_dialog.close()
_reset_create_form()
await refresh_table()
_show_config_dialog(device.name, config_text)
except Exception as e:
logger.error("Failed to create device: {}", e)