You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
Improve function name.
This commit is contained in:
@@ -63,7 +63,7 @@ export default React.createClass({
|
|||||||
* @param {Object} newProps The new properties of the component
|
* @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(newProps) {
|
_getNewState(newProps) {
|
||||||
const widgetPermissionId = [newProps.room.roomId, encodeURIComponent(newProps.url)].join('_');
|
const widgetPermissionId = [newProps.room.roomId, encodeURIComponent(newProps.url)].join('_');
|
||||||
const hasPermissionToLoad = localStorage.getItem(widgetPermissionId);
|
const hasPermissionToLoad = localStorage.getItem(widgetPermissionId);
|
||||||
return {
|
return {
|
||||||
@@ -79,7 +79,7 @@ export default React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return this._getNewUrlState(this.props);
|
return this._getNewState(this.props);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -176,7 +176,7 @@ export default React.createClass({
|
|||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (nextProps.url !== this.props.url) {
|
if (nextProps.url !== this.props.url) {
|
||||||
this._getNewUrlState(nextProps);
|
this._getNewState(nextProps);
|
||||||
this.setScalarToken();
|
this.setScalarToken();
|
||||||
} else if (nextProps.show && !this.props.show) {
|
} else if (nextProps.show && !this.props.show) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|||||||
Reference in New Issue
Block a user