You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Merge pull request #5184 from matrix-org/dbkr/always_allow_local_widgets
Always allow widgets when using the local version
This commit is contained in:
@@ -102,6 +102,8 @@ export default class AppTile extends React.Component {
|
|||||||
_getNewState(newProps) {
|
_getNewState(newProps) {
|
||||||
// This is a function to make the impact of calling SettingsStore slightly less
|
// This is a function to make the impact of calling SettingsStore slightly less
|
||||||
const hasPermissionToLoad = () => {
|
const hasPermissionToLoad = () => {
|
||||||
|
if (this._usingLocalWidget()) return true;
|
||||||
|
|
||||||
const currentlyAllowedWidgets = SettingsStore.getValue("allowedWidgets", newProps.room.roomId);
|
const currentlyAllowedWidgets = SettingsStore.getValue("allowedWidgets", newProps.room.roomId);
|
||||||
return !!currentlyAllowedWidgets[newProps.app.eventId];
|
return !!currentlyAllowedWidgets[newProps.app.eventId];
|
||||||
};
|
};
|
||||||
@@ -604,6 +606,15 @@ export default class AppTile extends React.Component {
|
|||||||
return uriFromTemplate(u, vars);
|
return uriFromTemplate(u, vars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether we're using a local version of the widget rather than loading the
|
||||||
|
* actual widget URL
|
||||||
|
* @returns {bool} true If using a local version of the widget
|
||||||
|
*/
|
||||||
|
_usingLocalWidget() {
|
||||||
|
return WidgetType.JITSI.matches(this.props.app.type);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the URL used in the iframe
|
* Get the URL used in the iframe
|
||||||
* In cases where we supply our own UI for a widget, this is an internal
|
* In cases where we supply our own UI for a widget, this is an internal
|
||||||
|
|||||||
Reference in New Issue
Block a user