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