Handle ManagedHybrid widgets in useRoomCall
and mark them in the widget state event
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
5a2595a093
commit
569832bc24
4 changed files with 21 additions and 8 deletions
|
@ -22,7 +22,7 @@ import { getCallBehaviourWellKnown } from "../utils/WellKnownUtils";
|
|||
import WidgetUtils from "../utils/WidgetUtils";
|
||||
import { IStoredLayout, WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore";
|
||||
import WidgetEchoStore from "../stores/WidgetEchoStore";
|
||||
import WidgetStore from "../stores/WidgetStore";
|
||||
import WidgetStore, { IApp } from "../stores/WidgetStore";
|
||||
import SdkConfig from "../SdkConfig";
|
||||
import DMRoomMap from "../utils/DMRoomMap";
|
||||
|
||||
|
@ -97,7 +97,10 @@ export async function addManagedHybridWidget(roomId: string): Promise<void> {
|
|||
|
||||
// Add the widget
|
||||
try {
|
||||
await WidgetUtils.setRoomWidgetContent(cli, roomId, widgetId, widgetContent);
|
||||
await WidgetUtils.setRoomWidgetContent(cli, roomId, widgetId, {
|
||||
...widgetContent,
|
||||
"io.element.managed_hybrid": true,
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error(`Unable to add managed hybrid widget in room ${roomId}`, e);
|
||||
return;
|
||||
|
@ -116,3 +119,7 @@ export async function addManagedHybridWidget(roomId: string): Promise<void> {
|
|||
WidgetLayoutStore.instance.setContainerHeight(room, layout.container, layout.height);
|
||||
WidgetLayoutStore.instance.copyLayoutToRoom(room);
|
||||
}
|
||||
|
||||
export function isManagedHybridWidget(widget: IApp): boolean {
|
||||
return !!widget["io.element.managed_hybrid"];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue