@@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
77*/
88
99import React , { type JSX , type ComponentProps , useContext } from "react" ;
10- import { type IWidget , MatrixCapabilities } from "matrix-widget-api" ;
10+ import { type ClientWidgetApi , type IWidget , MatrixCapabilities } from "matrix-widget-api" ;
1111import { logger } from "matrix-js-sdk/src/logger" ;
1212import { type ApprovalOpts , WidgetLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle" ;
1313import { type MatrixClient , type Room } from "matrix-js-sdk/src/matrix" ;
@@ -28,7 +28,7 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext";
2828import { Container , WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore" ;
2929import { getConfigLivestreamUrl , startJitsiAudioLivestream } from "../../../Livestream" ;
3030import { ModuleRunner } from "../../../modules/ModuleRunner" ;
31- import { ElementWidget , type WidgetMessaging } from "../../../stores/widgets/WidgetMessaging " ;
31+ import { ElementWidget } from "../../../stores/widgets/StopGapWidget " ;
3232import { useScopedRoomContext } from "../../../contexts/ScopedRoomContext.tsx" ;
3333
3434interface IProps extends Omit < ComponentProps < typeof IconizedContextMenu > , "children" > {
@@ -69,10 +69,10 @@ const showDeleteButton = (canModify: boolean, onDeleteClick: undefined | (() =>
6969 return ! ! onDeleteClick || canModify ;
7070} ;
7171
72- const showSnapshotButton = ( widgetMessaging : WidgetMessaging | undefined ) : boolean => {
72+ const showSnapshotButton = ( widgetMessaging : ClientWidgetApi | undefined ) : boolean => {
7373 return (
7474 SettingsStore . getValue ( "enableWidgetScreenshots" ) &&
75- ! ! widgetMessaging ?. widgetApi ?. hasCapability ( MatrixCapabilities . Screenshots )
75+ ! ! widgetMessaging ?. hasCapability ( MatrixCapabilities . Screenshots )
7676 ) ;
7777} ;
7878
@@ -123,7 +123,7 @@ export const WidgetContextMenu: React.FC<IProps> = ({
123123 if ( roomId && showStreamAudioStreamButton ( app ) ) {
124124 const onStreamAudioClick = async ( ) : Promise < void > => {
125125 try {
126- await startJitsiAudioLivestream ( cli , widgetMessaging ! . widgetApi ! , roomId ) ;
126+ await startJitsiAudioLivestream ( cli , widgetMessaging ! , roomId ) ;
127127 } catch ( err ) {
128128 logger . error ( "Failed to start livestream" , err ) ;
129129 // XXX: won't i18n well, but looks like widget api only support 'message'?
@@ -161,7 +161,7 @@ export const WidgetContextMenu: React.FC<IProps> = ({
161161 let snapshotButton : JSX . Element | undefined ;
162162 if ( showSnapshotButton ( widgetMessaging ) ) {
163163 const onSnapshotClick = ( ) : void => {
164- widgetMessaging ?. widgetApi
164+ widgetMessaging
165165 ?. takeScreenshot ( )
166166 . then ( ( data ) => {
167167 dis . dispatch ( {
0 commit comments