Fix content references
This commit is contained in:
@@ -62,7 +62,7 @@ export default class Stickerpicker extends React.Component {
|
|||||||
// Wrap this in a timeout in order to avoid the DOM node from being pulled from under its feet
|
// Wrap this in a timeout in order to avoid the DOM node from being pulled from under its feet
|
||||||
setTimeout(() => this.stickersMenu.close());
|
setTimeout(() => this.stickersMenu.close());
|
||||||
Widgets.removeStickerpickerWidgets().then(() => {
|
Widgets.removeStickerpickerWidgets().then(() => {
|
||||||
this._getStickerpickerContent();
|
this.forceUpdate();
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error('Failed to remove sticker picker widget', e);
|
console.error('Failed to remove sticker picker widget', e);
|
||||||
});
|
});
|
||||||
@@ -82,7 +82,6 @@ export default class Stickerpicker extends React.Component {
|
|||||||
if (!this.state.imError) {
|
if (!this.state.imError) {
|
||||||
this.dispatcherRef = dis.register(this._onWidgetAction);
|
this.dispatcherRef = dis.register(this._onWidgetAction);
|
||||||
}
|
}
|
||||||
this._getStickerpickerContent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
@@ -101,8 +100,7 @@ export default class Stickerpicker extends React.Component {
|
|||||||
|
|
||||||
_onWidgetAction(payload) {
|
_onWidgetAction(payload) {
|
||||||
if (payload.action === "user_widget_updated") {
|
if (payload.action === "user_widget_updated") {
|
||||||
this._getStickerpickerContent();
|
this.forceUpdate();
|
||||||
return;
|
|
||||||
} else if (payload.action === "stickerpicker_close") {
|
} else if (payload.action === "stickerpicker_close") {
|
||||||
// Wrap this in a timeout in order to avoid the DOM node from being
|
// Wrap this in a timeout in order to avoid the DOM node from being
|
||||||
// pulled from under its feet
|
// pulled from under its feet
|
||||||
@@ -186,7 +184,7 @@ export default class Stickerpicker extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
// Default content to show if stickerpicker widget not added
|
// Default content to show if stickerpicker widget not added
|
||||||
console.warn("No available sticker picker widgets");
|
console.warn("No available sticker picker widgets");
|
||||||
stickersContent = this.defaultStickersContent();
|
stickersContent = this._defaultStickerpickerContent();
|
||||||
this.widgetId = null;
|
this.widgetId = null;
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
@@ -202,7 +200,6 @@ export default class Stickerpicker extends React.Component {
|
|||||||
* @param {Event} e Event that triggered the function
|
* @param {Event} e Event that triggered the function
|
||||||
*/
|
*/
|
||||||
_onShowStickersClick(e) {
|
_onShowStickersClick(e) {
|
||||||
this._getStickerpickerContent();
|
|
||||||
const GenericElementContextMenu = sdk.getComponent('context_menus.GenericElementContextMenu');
|
const GenericElementContextMenu = sdk.getComponent('context_menus.GenericElementContextMenu');
|
||||||
const buttonRect = e.target.getBoundingClientRect();
|
const buttonRect = e.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user