Wire quick actions to reopen admin modals in-place

This commit is contained in:
Esdras Renan 2025-11-13 21:55:56 -03:00
parent 8db3b20a40
commit 6a75a0a9ed
4 changed files with 47 additions and 2 deletions

View file

@ -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.")