From 554bd4ca921199906bda6f19ec10708f04255b20 Mon Sep 17 00:00:00 2001 From: Timo k Date: Wed, 20 Oct 2021 18:03:35 +0200 Subject: [PATCH] NoPopout Capability Fix #15744 --- .../views/dialogs/WidgetCapabilitiesPromptDialog.tsx | 1 + src/components/views/elements/AppTile.tsx | 7 ++++++- src/widgets/CapabilityText.tsx | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx index 366adb887c12..ae11f41c1384 100644 --- a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx +++ b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx @@ -106,6 +106,7 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent< return 0; }); + // const filteredCapabilites = //TODO this would be where the NoPopout capability text can be hidden and approved by default const checkboxRows = orderedCapabilities.map(([cap, isChecked], i) => { const text = CapabilityText.for(cap, this.props.widgetKind); const byline = text.byline diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index 5f7c0543c411..d8d145697822 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -84,6 +84,7 @@ interface IState { error: Error; menuDisplayed: boolean; widgetPageTitle: string; + noPopout: boolean; } import { logger } from "matrix-js-sdk/src/logger"; @@ -155,6 +156,7 @@ export default class AppTile extends React.Component { error: null, menuDisplayed: false, widgetPageTitle: this.props.widgetPageTitle, + noPopout: true, }; } @@ -295,6 +297,9 @@ export default class AppTile extends React.Component { if (WidgetType.JITSI.matches(this.props.app.type)) { this.sgWidget.widgetApi.transport.send(ElementWidgetActions.ClientReady, {}); } + this.setState({ + noPopout: this.sgWidget.widgetApi.hasCapability(MatrixCapabilities.NoPopout) + }); }; private onAction = (payload): void => { @@ -512,7 +517,7 @@ export default class AppTile extends React.Component { { this.props.showTitle && this.getTileTitle() } - { this.props.showPopout &&