Fix the sticker picker (#7692) (#7695)

* 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:40:50 +00:00 committed by GitHub
parent 6c16a2c9dd
commit 806cd264df
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; if (this.props.room.roomId == RoomViewStore.getRoomId()) return;
const app = this.props.app; const app = this.props.app;
const isActiveWidget = ActiveWidgetStore.instance.getWidgetPersistence(app.id); 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); ActiveWidgetStore.instance.destroyPersistentWidget(app.id);
PersistedElement.destroyElement(this.persistKey); PersistedElement.destroyElement(this.persistKey);
this.sgWidget?.stopMessaging(); this.sgWidget?.stopMessaging();