You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Destroy non-persistent widgets when switching room
This commit is contained in:
@@ -161,6 +161,8 @@ export default class AppTile extends React.Component {
|
|||||||
// if it's not remaining on screen, get rid of the PersistedElement container
|
// if it's not remaining on screen, get rid of the PersistedElement container
|
||||||
if (!ActiveWidgetStore.getWidgetPersistence(this.props.id)) {
|
if (!ActiveWidgetStore.getWidgetPersistence(this.props.id)) {
|
||||||
ActiveWidgetStore.destroyPersistentWidget();
|
ActiveWidgetStore.destroyPersistentWidget();
|
||||||
|
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
||||||
|
PersistedElement.destroyElement(this._persistKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,6 +439,7 @@ export default class AppTile extends React.Component {
|
|||||||
|
|
||||||
// Force the widget to be non-persistent
|
// Force the widget to be non-persistent
|
||||||
ActiveWidgetStore.destroyPersistentWidget();
|
ActiveWidgetStore.destroyPersistentWidget();
|
||||||
|
PersistedElement.destroyElement(this._persistKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
formatAppTileName() {
|
formatAppTileName() {
|
||||||
|
|||||||
@@ -75,8 +75,6 @@ class ActiveWidgetStore extends EventEmitter {
|
|||||||
destroyPersistentWidget() {
|
destroyPersistentWidget() {
|
||||||
const toDeleteId = this._persistentWidgetId;
|
const toDeleteId = this._persistentWidgetId;
|
||||||
|
|
||||||
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
|
||||||
PersistedElement.destroyElement('widget_' + toDeleteId);
|
|
||||||
this.setWidgetPersistence(toDeleteId, false);
|
this.setWidgetPersistence(toDeleteId, false);
|
||||||
this.delWidgetMessaging(toDeleteId);
|
this.delWidgetMessaging(toDeleteId);
|
||||||
this.delWidgetCapabilities(toDeleteId);
|
this.delWidgetCapabilities(toDeleteId);
|
||||||
|
|||||||
Reference in New Issue
Block a user