()
| 217 | }; |
| 218 | |
| 219 | const handleSaveName = async () => { |
| 220 | const trimmed = editName.trim(); |
| 221 | if (!trimmed || trimmed === organizationName) { |
| 222 | setEditName(organizationName); |
| 223 | return; |
| 224 | } |
| 225 | setSavingName(true); |
| 226 | const exit = await doUpdateOrgName({ |
| 227 | payload: { name: trimmed }, |
| 228 | reactivityKeys: orgInfoWriteKeys, |
| 229 | }); |
| 230 | trackEvent("org_renamed", { success: Exit.isSuccess(exit) }); |
| 231 | if (Exit.isSuccess(exit)) { |
| 232 | toast.success("Organization name updated"); |
| 233 | } else { |
| 234 | toast.error("Failed to update organization name"); |
| 235 | setEditName(organizationName); |
| 236 | } |
| 237 | setSavingName(false); |
| 238 | }; |
| 239 | |
| 240 | return ( |
| 241 | <PageContainer> |
no test coverage detected