diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index 779d946..0eec76f 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -10,7 +10,9 @@ import Container from 'react-bootstrap/Container'; import Row from 'react-bootstrap/Row'; import Col from 'react-bootstrap/Col'; import Stack from 'react-bootstrap/Stack'; -import { WidgetApi, EventDirection, WidgetEventCapability } from 'matrix-widget-api'; +import { + WidgetApi, EventDirection, WidgetEventCapability, MatrixCapabilities, +} from 'matrix-widget-api'; // import { MuiCapabilitiesGuard } from '@matrix-widget-toolkit/mui'; // import { useWidgetApi } from '@matrix-widget-toolkit/react'; @@ -255,6 +257,15 @@ function Widget() { widgetApi.current = new WidgetApi(); + widgetApi.current.requestCapability(MatrixCapabilities.AlwaysOnScreen); + + // widgetApi.current.requestCapabilities([ + // WidgetEventCapability.forRoomEvent( + // EventDirection.Send, + // 'm.message', + // ), + // ]); + widgetApi.current.on('ready', (e) => { console.log('WIDGET READY', e); }); @@ -356,7 +367,7 @@ function Widget() { 'm.message', ), ]); - widgetApi.current.sendRoomEvent('m.message', 'test message'); + await widgetApi.current.sendRoomEvent('m.message', 'test message'); }; /* -------------------------------------------------------------------------------- */