Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
rename state to requireClient
Browse files Browse the repository at this point in the history
& remove approval text
  • Loading branch information
toger5 committed Oct 25, 2021
1 parent a2c79a7 commit 2135584
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ interface IState {
error: Error;
menuDisplayed: boolean;
widgetPageTitle: string;
noPopoutButton: boolean;
requiresClient: boolean;
}

import { logger } from "matrix-js-sdk/src/logger";
Expand Down Expand Up @@ -156,7 +156,7 @@ export default class AppTile extends React.Component<IProps, IState> {
error: null,
menuDisplayed: false,
widgetPageTitle: this.props.widgetPageTitle,
noPopoutButton: true,
requiresClient: true,
};
}

Expand Down Expand Up @@ -298,7 +298,7 @@ export default class AppTile extends React.Component<IProps, IState> {
this.sgWidget.widgetApi.transport.send(ElementWidgetActions.ClientReady, {});
}
this.setState({
noPopoutButton: this.sgWidget.widgetApi.hasCapability(MatrixCapabilities.RequiresClient)
requiresClient: this.sgWidget.widgetApi.hasCapability(MatrixCapabilities.RequiresClient)
});
};

Expand Down Expand Up @@ -517,7 +517,7 @@ export default class AppTile extends React.Component<IProps, IState> {
{ this.props.showTitle && this.getTileTitle() }
</span>
<span className="mx_AppTileMenuBarWidgets">
{(this.props.showPopout && !this.state.noPopoutButton) && <AccessibleButton
{(this.props.showPopout && !this.state.requiresClient) && <AccessibleButton
className="mx_AppTileMenuBar_iconButton mx_AppTileMenuBar_iconButton_popout"
title={_t('Popout widget')}
onClick={this.onPopoutWidgetClick}
Expand Down
5 changes: 1 addition & 4 deletions src/widgets/CapabilityText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ export class CapabilityText {
},
[MatrixCapabilities.MSC2931Navigate]: {
[GENERIC_WIDGET_KIND]: _td("Change which room, message, or user you're viewing"),
},
[MatrixCapabilities.RequiresClient]: {
[GENERIC_WIDGET_KIND]: _td("Prohibits Element from showing the widget popout button."),
},
}
};

private static stateSendRecvCaps: ISendRecvStaticCapText = {
Expand Down

0 comments on commit 2135584

Please sign in to comment.