()
| 101 | const confirmed = confirmText.trim() === organizationName.trim(); |
| 102 | |
| 103 | const handleDelete = async () => { |
| 104 | if (!confirmed || deleting) return; |
| 105 | setDeleting(true); |
| 106 | const exit = await doDelete({ |
| 107 | payload: { confirmName: confirmText.trim() }, |
| 108 | reactivityKeys: authWriteKeys, |
| 109 | }); |
| 110 | trackEvent("org_deleted", { success: Exit.isSuccess(exit) }); |
| 111 | if (Exit.isSuccess(exit)) { |
| 112 | // The org (and the caller's session) are gone. A full navigation resets |
| 113 | // all app state and lets the auth gate rehydrate to another membership or |
| 114 | // the create-org screen. |
| 115 | toast.success(`Deleted ${organizationName}`); |
| 116 | window.location.href = "/"; |
| 117 | return; |
| 118 | } |
| 119 | setDeleting(false); |
| 120 | toast.error("Failed to delete organization"); |
| 121 | }; |
| 122 | |
| 123 | return ( |
| 124 | <section className="mb-2 border-t border-border pt-8"> |
no test coverage detected