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
Make ActiveWidgetStore clear persistent widgets
ActiveWidgetStore is now reponsible for removing the current persistent widget from the store if it's been removed from whatever room it was in. As per comment, this leaves us with the store updating itself in this case but in all other cases, views call setters on the store to update its state. We should make it so the store keeps itself up to date and views aren't responsible for keeping the store up to date. The store now emits events so it can notify PersistentApp when it changes. Fixes https://github.com/vector-im/riot-web/issues/7076
This commit is contained in:
@@ -30,6 +30,7 @@ import DMRoomMap from './utils/DMRoomMap';
|
||||
import RtsClient from './RtsClient';
|
||||
import Modal from './Modal';
|
||||
import sdk from './index';
|
||||
import ActiveWidgetStore from './stores/ActiveWidgetStore';
|
||||
|
||||
/**
|
||||
* Called at startup, to attempt to build a logged-in Matrix session. It tries
|
||||
@@ -436,6 +437,7 @@ async function startMatrixClient() {
|
||||
UserActivity.start();
|
||||
Presence.start();
|
||||
DMRoomMap.makeShared().start();
|
||||
ActiveWidgetStore.start();
|
||||
|
||||
await MatrixClientPeg.start();
|
||||
|
||||
@@ -488,6 +490,7 @@ export function stopMatrixClient() {
|
||||
Notifier.stop();
|
||||
UserActivity.stop();
|
||||
Presence.stop();
|
||||
ActiveWidgetStore.start();
|
||||
if (DMRoomMap.shared()) DMRoomMap.shared().stop();
|
||||
const cli = MatrixClientPeg.get();
|
||||
if (cli) {
|
||||
|
||||
Reference in New Issue
Block a user