Type the paarrot api, WebKit globals, and plugin command content. [skip build]
This commit is contained in:
@@ -69,10 +69,8 @@ function checkWebRTCSupport(): { supported: boolean; details: Record<string, unk
|
||||
);
|
||||
|
||||
// Check WebKit-specific APIs
|
||||
details.hasWebkitGetUserMedia = !!(
|
||||
navigator.getUserMedia || (navigator as any).webkitGetUserMedia
|
||||
);
|
||||
details.hasWebkitRTCPeerConnection = !!(window as any).webkitRTCPeerConnection;
|
||||
details.hasWebkitGetUserMedia = !!(navigator.getUserMedia || navigator.webkitGetUserMedia);
|
||||
details.hasWebkitRTCPeerConnection = !!window.webkitRTCPeerConnection;
|
||||
|
||||
// Check if mediaDevices API exists
|
||||
details.hasMediaDevices = !!navigator.mediaDevices;
|
||||
@@ -83,7 +81,7 @@ function checkWebRTCSupport(): { supported: boolean; details: Record<string, unk
|
||||
const supported = !!(
|
||||
navigator.mediaDevices &&
|
||||
navigator.mediaDevices.getUserMedia &&
|
||||
(window.RTCPeerConnection || (window as any).webkitRTCPeerConnection)
|
||||
(window.RTCPeerConnection || window.webkitRTCPeerConnection)
|
||||
);
|
||||
|
||||
return { supported, details };
|
||||
|
||||
@@ -10,6 +10,7 @@ import React, {
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { isKeyHotkey } from 'is-hotkey';
|
||||
import { EventType, IContent, MsgType, RelationType, Room } from 'matrix-js-sdk';
|
||||
import { RoomMessageEventContent } from 'matrix-js-sdk/lib/types';
|
||||
import { Transforms, Editor } from 'slate';
|
||||
import {
|
||||
Box,
|
||||
@@ -405,11 +406,11 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
|
||||
const result = await pluginRegistry.executeCommand(commandName, plainText, roomId);
|
||||
if (result) {
|
||||
// If command returns text, send it as a message
|
||||
const content: IContent = {
|
||||
const content: RoomMessageEventContent = {
|
||||
msgtype: MsgType.Text,
|
||||
body: result,
|
||||
};
|
||||
mx.sendMessage(roomId, content as any);
|
||||
mx.sendMessage(roomId, content);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(`[RoomInput] Plugin command /${commandName} failed:`, err);
|
||||
|
||||
Reference in New Issue
Block a user