mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 20:38:55 +03:00
Update variable name and JSdoc for improved clarity.
This commit is contained in:
parent
ca1ffdfa9f
commit
be0a76dbd6
1 changed files with 6 additions and 6 deletions
|
@ -59,20 +59,20 @@ export default React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set initial component state when the App wUrl (widget URL) is being updated
|
* Set initial component state when the App wUrl (widget URL) is being updated. Component props *must* be passed (rather than relying on this.props).
|
||||||
* @param {Object} props The component props *must* be passed (rather than using this.props) so that it can be called with future props, e.g. from componentWillReceiveProps.
|
* @param {Object} newProps The new properties of the component
|
||||||
* @return {Object} Updated component state to be set with setState
|
* @return {Object} Updated component state to be set with setState
|
||||||
*/
|
*/
|
||||||
_getNewUrlState(props) {
|
_getNewUrlState(newProps) {
|
||||||
const widgetPermissionId = [props.room.roomId, encodeURIComponent(props.url)].join('_');
|
const widgetPermissionId = [newProps.room.roomId, encodeURIComponent(newProps.url)].join('_');
|
||||||
const hasPermissionToLoad = localStorage.getItem(widgetPermissionId);
|
const hasPermissionToLoad = localStorage.getItem(widgetPermissionId);
|
||||||
return {
|
return {
|
||||||
initialising: true, // True while we are mangling the widget URL
|
initialising: true, // True while we are mangling the widget URL
|
||||||
loading: true, // True while the iframe content is loading
|
loading: true, // True while the iframe content is loading
|
||||||
widgetUrl: props.url,
|
widgetUrl: newProps.url,
|
||||||
widgetPermissionId: widgetPermissionId,
|
widgetPermissionId: widgetPermissionId,
|
||||||
// Assume that widget has permission to load if we are the user who added it to the room, or if explicitly granted by the user
|
// Assume that widget has permission to load if we are the user who added it to the room, or if explicitly granted by the user
|
||||||
hasPermissionToLoad: hasPermissionToLoad === 'true' || props.userId === props.creatorUserId,
|
hasPermissionToLoad: hasPermissionToLoad === 'true' || newProps.userId === newProps.creatorUserId,
|
||||||
error: null,
|
error: null,
|
||||||
deleting: false,
|
deleting: false,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue