use wildcard for widget client origin
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 35s Details

This commit is contained in:
Ladd Hoffman 2024-04-26 19:45:33 -05:00
parent 435553bf05
commit 58dc26ee30
1 changed files with 2 additions and 25 deletions

View File

@ -244,37 +244,14 @@ function Widget() {
/* --------------------------- END MAIN INITIALIZION EFFECT ----------------------- */
/* -------------------------------------------------------------------------------- */
// useEffect(() => {
// // api.requestCapability(MatrixCapabilities.)
// api.on('action:m.message', (ev) => {
// console.log('action:m.message', ev);
// });
// api.start();
// }, []);
useEffect(() => {
console.log('window.location', window.location);
const { searchParams } = new URL(window.location.href);
const widgetId = searchParams.get('widgetId');
widgetApi.current = widgetApi.current ?? new WidgetApi(widgetId, 'https://chat.dgov.io');
console.log('widget api', widgetApi.current);
// widgetApi.current.requestCapability(MatrixCapabilities.AlwaysOnScreen);
// widgetApi.current.requestCapabilities([
// WidgetEventCapability.forRoomEvent(
// EventDirection.Send,
// 'm.message',
// ),
// ]);
// widgetApi.current.updateRequestedCapabilities();
widgetApi.current.on('ready', (e) => {
console.log('WIDGET READY', e);
widgetApi.current = widgetApi.current ?? new WidgetApi(widgetId, '*');
widgetApi.current.on('ready', () => {
const sendMessageCapability = WidgetEventCapability.forRoomEvent(
EventDirection.Send,
'm.room.message',