Support for incoming gift badges
This commit is contained in:
parent
6b4bea6330
commit
0ba6a0926e
41 changed files with 1476 additions and 164 deletions
|
@ -11,6 +11,7 @@ import { markViewed } from '../services/MessageUpdater';
|
|||
import { isIncoming, isStory } from '../state/selectors/message';
|
||||
import { notificationService } from '../services/notifications';
|
||||
import * as log from '../logging/log';
|
||||
import { GiftBadgeStates } from '../components/conversation/Message';
|
||||
|
||||
export type ViewSyncAttributesType = {
|
||||
senderId: string;
|
||||
|
@ -92,6 +93,16 @@ export class ViewSyncs extends Collection {
|
|||
message.set(markViewed(message.attributes, sync.get('viewedAt')));
|
||||
}
|
||||
|
||||
const giftBadge = message.get('giftBadge');
|
||||
if (giftBadge) {
|
||||
message.set({
|
||||
giftBadge: {
|
||||
...giftBadge,
|
||||
state: GiftBadgeStates.Redeemed,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
this.remove(sync);
|
||||
} catch (error) {
|
||||
log.error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue