request a capability
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s Details

This commit is contained in:
Ladd Hoffman 2024-04-25 15:41:46 -05:00
parent 8cc14bc7d5
commit bc4b9f6a5b
1 changed files with 13 additions and 2 deletions

View File

@ -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');
};
/* -------------------------------------------------------------------------------- */