mirror of
https://github.com/element-hq/element-web
synced 2024-10-26 04:35:55 +03:00
Merge pull request #3338 from matrix-org/t3chguy/fix_jitsi_persisted_breaking_randomly
Only Destroy the expected persistent widget, not *ANY*
This commit is contained in:
commit
838e115b72
2 changed files with 6 additions and 6 deletions
|
@ -154,10 +154,9 @@ export default class AppTile extends React.Component {
|
||||||
// Widget action listeners
|
// Widget action listeners
|
||||||
dis.unregister(this.dispatcherRef);
|
dis.unregister(this.dispatcherRef);
|
||||||
|
|
||||||
const canPersist = this.props.whitelistCapabilities.includes('m.always_on_screen');
|
|
||||||
// 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 (canPersist && !ActiveWidgetStore.getWidgetPersistence(this.props.id)) {
|
if (!ActiveWidgetStore.getWidgetPersistence(this.props.id)) {
|
||||||
ActiveWidgetStore.destroyPersistentWidget();
|
ActiveWidgetStore.destroyPersistentWidget(this.props.id);
|
||||||
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
||||||
PersistedElement.destroyElement(this._persistKey);
|
PersistedElement.destroyElement(this._persistKey);
|
||||||
}
|
}
|
||||||
|
@ -451,7 +450,7 @@ export default class AppTile extends React.Component {
|
||||||
this.setState({hasPermissionToLoad: false});
|
this.setState({hasPermissionToLoad: false});
|
||||||
|
|
||||||
// Force the widget to be non-persistent
|
// Force the widget to be non-persistent
|
||||||
ActiveWidgetStore.destroyPersistentWidget();
|
ActiveWidgetStore.destroyPersistentWidget(this.props.id);
|
||||||
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
||||||
PersistedElement.destroyElement(this._persistKey);
|
PersistedElement.destroyElement(this._persistKey);
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,11 +67,12 @@ class ActiveWidgetStore extends EventEmitter {
|
||||||
if (ev.getType() !== 'im.vector.modular.widgets') return;
|
if (ev.getType() !== 'im.vector.modular.widgets') return;
|
||||||
|
|
||||||
if (ev.getStateKey() === this._persistentWidgetId) {
|
if (ev.getStateKey() === this._persistentWidgetId) {
|
||||||
this.destroyPersistentWidget();
|
this.destroyPersistentWidget(this._persistentWidgetId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
destroyPersistentWidget() {
|
destroyPersistentWidget(id) {
|
||||||
|
if (id !== this._persistentWidgetId) return;
|
||||||
const toDeleteId = this._persistentWidgetId;
|
const toDeleteId = this._persistentWidgetId;
|
||||||
|
|
||||||
this.setWidgetPersistence(toDeleteId, false);
|
this.setWidgetPersistence(toDeleteId, false);
|
||||||
|
|
Loading…
Reference in a new issue