()
| 198 | }; |
| 199 | |
| 200 | const handleSaveName = async () => { |
| 201 | const trimmed = editName.trim(); |
| 202 | if (!trimmed || trimmed === organizationName) { |
| 203 | setEditName(organizationName); |
| 204 | return; |
| 205 | } |
| 206 | setSavingName(true); |
| 207 | const exit = await doUpdateOrgName({ |
| 208 | payload: { name: trimmed }, |
| 209 | reactivityKeys: orgInfoWriteKeys, |
| 210 | }); |
| 211 | trackEvent("org_renamed", { success: Exit.isSuccess(exit) }); |
| 212 | if (Exit.isSuccess(exit)) { |
| 213 | toast.success("Organization name updated"); |
| 214 | } else { |
| 215 | toast.error("Failed to update organization name"); |
| 216 | setEditName(organizationName); |
| 217 | } |
| 218 | setSavingName(false); |
| 219 | }; |
| 220 | |
| 221 | return ( |
| 222 | <PageContainer> |
no test coverage detected