Fix the sticker picker (#7692)

* Fix the sticker picker

Don't stop user widgets on room change: they're not room-specific.

Fixes https://github.com/vector-im/element-web/issues/20797

* Use 'userWidget' prop rather than roomId being defined
This commit is contained in:
David Baker 2022-02-01 15:34:22 +00:00 committed by GitHub
parent 98c5f50f36
commit 5b999300b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,8 @@ export default class AppTile extends React.Component<IProps, IState> {
if (this.props.room.roomId == RoomViewStore.getRoomId()) return;
const app = this.props.app;
const isActiveWidget = ActiveWidgetStore.instance.getWidgetPersistence(app.id);
if (!isActiveWidget) {
// Stop the widget if it's not the active (persistent) widget and it's not a user widget
if (!isActiveWidget && !this.props.userWidget) {
ActiveWidgetStore.instance.destroyPersistentWidget(app.id);
PersistedElement.destroyElement(this.persistKey);
this.sgWidget?.stopMessaging();