Fix more import/export tests for backups

This commit is contained in:
Fedor Indutny 2024-09-16 17:40:52 -07:00 committed by GitHub
parent 8dabe4fbe4
commit 84c562d0b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 225 additions and 60 deletions

View file

@ -196,14 +196,22 @@ export enum GiftBadgeStates {
Unopened = 'Unopened',
Opened = 'Opened',
Redeemed = 'Redeemed',
Failed = 'Failed',
}
export type GiftBadgeType = {
expiration: number;
id: string | undefined;
level: number;
state: GiftBadgeStates;
};
export type GiftBadgeType =
| {
state:
| GiftBadgeStates.Unopened
| GiftBadgeStates.Opened
| GiftBadgeStates.Redeemed;
expiration: number;
id: string | undefined;
level: number;
}
| {
state: GiftBadgeStates.Failed;
};
export type PropsData = {
id: string;
@ -1385,7 +1393,10 @@ export class Message extends React.PureComponent<Props, State> {
return null;
}
if (giftBadge.state === GiftBadgeStates.Unopened) {
if (
giftBadge.state === GiftBadgeStates.Unopened ||
giftBadge.state === GiftBadgeStates.Failed
) {
const description =
direction === 'incoming'
? i18n('icu:message--donation--unopened--incoming')