Wire quick actions to reopen admin modals in-place
This commit is contained in:
parent
8db3b20a40
commit
6a75a0a9ed
4 changed files with 47 additions and 2 deletions
|
|
@ -1569,6 +1569,15 @@ export function AdminDevicesOverview({
|
|||
}
|
||||
}, [autoOpenCreateDevice, handleOpenCreateDevice])
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return
|
||||
const handler = () => {
|
||||
handleOpenCreateDevice()
|
||||
}
|
||||
window.addEventListener("quick-open-device", handler)
|
||||
return () => window.removeEventListener("quick-open-device", handler)
|
||||
}, [handleOpenCreateDevice])
|
||||
|
||||
const handleCreateDevice = useCallback(async () => {
|
||||
if (!convexUserId) {
|
||||
toast.error("Sincronize a sessão antes de criar dispositivos.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue