Support for incoming gift badges
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user