Skip to content

Commit

Permalink
Improve reaction types
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn-Signal committed Oct 13, 2021
1 parent 35a54cd commit 21c00f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ts/messageModifiers/Reactions.ts
Expand Up @@ -13,7 +13,7 @@ export class ReactionModel extends Model<ReactionAttributesType> {}

let singleton: Reactions | undefined;

export class Reactions extends Collection {
export class Reactions extends Collection<ReactionModel> {
static getSingleton(): Reactions {
if (!singleton) {
singleton = new Reactions();
Expand Down
2 changes: 1 addition & 1 deletion ts/model-types.d.ts
Expand Up @@ -373,7 +373,7 @@ export type ReactionAttributesType = {
remove?: boolean;
targetAuthorUuid: string;
targetTimestamp: number;
fromId?: string;
fromId: string;
timestamp: number;
fromSync?: boolean;
};
2 changes: 1 addition & 1 deletion ts/models/conversations.ts
Expand Up @@ -4870,7 +4870,7 @@ export class ConversationModel extends window.Backbone

async notify(
message: Readonly<MessageModel>,
reaction?: WhatIsThis
reaction?: Readonly<ReactionModel>
): Promise<void> {
// As a performance optimization don't perform any work if notifications are
// disabled.
Expand Down
4 changes: 2 additions & 2 deletions ts/models/messages.ts
Expand Up @@ -108,7 +108,7 @@ import {
MessageReceiptType,
} from '../messageModifiers/MessageReceipts';
import { Deletes } from '../messageModifiers/Deletes';
import { Reactions } from '../messageModifiers/Reactions';
import { Reactions, ReactionModel } from '../messageModifiers/Reactions';
import { ReadSyncs } from '../messageModifiers/ReadSyncs';
import { ViewSyncs } from '../messageModifiers/ViewSyncs';
import { ViewOnceOpenSyncs } from '../messageModifiers/ViewOnceOpenSyncs';
Expand Down Expand Up @@ -3167,7 +3167,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
}

async handleReaction(
reaction: typeof window.WhatIsThis,
reaction: ReactionModel,
shouldPersist = true
): Promise<ReactionAttributesType | undefined> {
const { attributes } = this;
Expand Down

0 comments on commit 21c00f5

Please sign in to comment.