mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +00:00
Add type def for custom reaction type.
This commit is contained in:
18
src/@types/matrix-js-sdk.d.ts
vendored
Normal file
18
src/@types/matrix-js-sdk.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2024 New Vector Ltd.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
Please see LICENSE in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {
|
||||||
|
ElementCallReactionEventType,
|
||||||
|
ECallReactionEventContent,
|
||||||
|
} from "../reactions";
|
||||||
|
|
||||||
|
// Extend Matrix JS SDK types via Typescript declaration merging to support unspecced event fields and types
|
||||||
|
declare module "matrix-js-sdk/src/types" {
|
||||||
|
export interface TimelineEvents {
|
||||||
|
[ElementCallReactionEventType]: ECallReactionEventContent;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,7 +36,6 @@ import { useReactions } from "../useReactions";
|
|||||||
import { useMatrixRTCSessionMemberships } from "../useMatrixRTCSessionMemberships";
|
import { useMatrixRTCSessionMemberships } from "../useMatrixRTCSessionMemberships";
|
||||||
import styles from "./ReactionToggleButton.module.css";
|
import styles from "./ReactionToggleButton.module.css";
|
||||||
import {
|
import {
|
||||||
ECallReactionEventContent,
|
|
||||||
ReactionOption,
|
ReactionOption,
|
||||||
ReactionSet,
|
ReactionSet,
|
||||||
ElementCallReactionEventType,
|
ElementCallReactionEventType,
|
||||||
@@ -195,7 +194,6 @@ export function ReactionToggleButton({
|
|||||||
const parentEventId = myMembership.eventId;
|
const parentEventId = myMembership.eventId;
|
||||||
try {
|
try {
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
// @ts-expect-error Trying to send a unspec'd event seems to miss the 3rd overload, need to come back to this.
|
|
||||||
await client.sendEvent(
|
await client.sendEvent(
|
||||||
rtcSession.room.roomId,
|
rtcSession.room.roomId,
|
||||||
null,
|
null,
|
||||||
@@ -207,7 +205,8 @@ export function ReactionToggleButton({
|
|||||||
},
|
},
|
||||||
emoji: reaction.emoji,
|
emoji: reaction.emoji,
|
||||||
name: reaction.name,
|
name: reaction.name,
|
||||||
} as ECallReactionEventContent,
|
},
|
||||||
|
undefined,
|
||||||
);
|
);
|
||||||
// Do NOT close the menu after this.
|
// Do NOT close the menu after this.
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user