()
| 234 | }; |
| 235 | |
| 236 | const handleSaveName = async () => { |
| 237 | const trimmed = editName.trim(); |
| 238 | if (!trimmed || trimmed === organizationName) { |
| 239 | setEditName(organizationName); |
| 240 | return; |
| 241 | } |
| 242 | setSavingName(true); |
| 243 | const exit = await doUpdateOrgName({ |
| 244 | payload: { name: trimmed }, |
| 245 | reactivityKeys: orgInfoWriteKeys, |
| 246 | }); |
| 247 | trackEvent("org_renamed", { success: Exit.isSuccess(exit) }); |
| 248 | if (Exit.isSuccess(exit)) { |
| 249 | toast.success("Organization name updated"); |
| 250 | } else { |
| 251 | toast.error("Failed to update organization name"); |
| 252 | setEditName(organizationName); |
| 253 | } |
| 254 | setSavingName(false); |
| 255 | }; |
| 256 | |
| 257 | return ( |
| 258 | <PageContainer> |
no test coverage detected