Fix modal text on username gone error

This commit is contained in:
Fedor Indutny 2023-03-08 17:38:52 -08:00 committed by GitHub
parent 74097a0efa
commit 64827af27f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -281,7 +281,7 @@ export function EditUsernameModalBody({
}}
>
{i18n('icu:ProfileEditor--username--reservation-gone', {
username: currentUsername,
username: reservation?.username ?? nickname,
})}
</ConfirmationDialog>
)}

View file

@ -433,6 +433,7 @@ export function reducer(
return {
...state,
usernameReservation: {
reservation: state.usernameReservation.reservation,
state: UsernameReservationState.Open,
error: UsernameReservationError.ConflictOrGone,
},

View file

@ -389,7 +389,10 @@ describe('electron/state/ducks/username', () => {
getUsernameReservationState(state),
UsernameReservationState.Open
);
assert.strictEqual(getUsernameReservationObject(state), undefined);
assert.strictEqual(
getUsernameReservationObject(state),
DEFAULT_RESERVATION
);
assert.strictEqual(
getUsernameReservationError(state),
UsernameReservationError.ConflictOrGone