mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 18:38:15 +01:00
Handle 409/410 when confirming username
This commit is contained in:
@@ -120,7 +120,10 @@ export function EditUsernameModalBody({
|
||||
return i18n('ProfileEditor--username--unavailable');
|
||||
}
|
||||
// Displayed through confirmation modal below
|
||||
if (error === UsernameReservationError.General) {
|
||||
if (
|
||||
error === UsernameReservationError.General ||
|
||||
error === UsernameReservationError.ConflictOrGone
|
||||
) {
|
||||
return;
|
||||
}
|
||||
throw missingCaseError(error);
|
||||
@@ -264,6 +267,24 @@ export function EditUsernameModalBody({
|
||||
{i18n('ProfileEditor--username--general-error')}
|
||||
</ConfirmationDialog>
|
||||
)}
|
||||
|
||||
{error === UsernameReservationError.ConflictOrGone && (
|
||||
<ConfirmationDialog
|
||||
dialogName="EditUsernameModalBody.conflictOrGone"
|
||||
cancelText={i18n('ok')}
|
||||
cancelButtonVariant={ButtonVariant.Secondary}
|
||||
i18n={i18n}
|
||||
onClose={() => {
|
||||
if (nickname) {
|
||||
reserveUsername(nickname);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{i18n('icu:ProfileEditor--username--reservation-gone', {
|
||||
username: currentUsername,
|
||||
})}
|
||||
</ConfirmationDialog>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user