Fix Persisted Widgets (Jitsi) randomly closing on room change
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
e3348c6184
commit
7b17ea1fa5
1 changed files with 6 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
/**
|
/*
|
||||||
Copyright 2017 Vector Creations Ltd
|
Copyright 2017 Vector Creations Ltd
|
||||||
Copyright 2018 New Vector Ltd
|
Copyright 2018 New Vector Ltd
|
||||||
|
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -15,8 +16,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
import url from 'url';
|
import url from 'url';
|
||||||
import qs from 'querystring';
|
import qs from 'querystring';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
@ -155,8 +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 (!ActiveWidgetStore.getWidgetPersistence(this.props.id)) {
|
if (canPersist && !ActiveWidgetStore.getWidgetPersistence(this.props.id)) {
|
||||||
ActiveWidgetStore.destroyPersistentWidget();
|
ActiveWidgetStore.destroyPersistentWidget();
|
||||||
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
const PersistedElement = sdk.getComponent("elements.PersistedElement");
|
||||||
PersistedElement.destroyElement(this._persistKey);
|
PersistedElement.destroyElement(this._persistKey);
|
||||||
|
@ -575,11 +575,10 @@ export default class AppTile extends React.Component {
|
||||||
src={this._getSafeUrl()}
|
src={this._getSafeUrl()}
|
||||||
allowFullScreen="true"
|
allowFullScreen="true"
|
||||||
sandbox={sandboxFlags}
|
sandbox={sandboxFlags}
|
||||||
onLoad={this._onLoaded}
|
onLoad={this._onLoaded} />
|
||||||
></iframe>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
// if the widget would be allowed to remian on screen, we must put it in
|
// if the widget would be allowed to remain on screen, we must put it in
|
||||||
// a PersistedElement from the get-go, otherwise the iframe will be
|
// a PersistedElement from the get-go, otherwise the iframe will be
|
||||||
// re-mounted later when we do.
|
// re-mounted later when we do.
|
||||||
if (this.props.whitelistCapabilities.includes('m.always_on_screen')) {
|
if (this.props.whitelistCapabilities.includes('m.always_on_screen')) {
|
||||||
|
|
Loading…
Reference in a new issue