mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 11:15:53 +03:00
Start and stop Mjolnir with the lifecycle
This commit is contained in:
parent
e6e12df82d
commit
e9c8a31e1f
1 changed files with 7 additions and 0 deletions
|
@ -36,6 +36,7 @@ import * as StorageManager from './utils/StorageManager';
|
|||
import SettingsStore from "./settings/SettingsStore";
|
||||
import TypingStore from "./stores/TypingStore";
|
||||
import {IntegrationManagers} from "./integrations/IntegrationManagers";
|
||||
import {Mjolnir} from "./mjolnir/Mjolnir";
|
||||
|
||||
/**
|
||||
* Called at startup, to attempt to build a logged-in Matrix session. It tries
|
||||
|
@ -585,6 +586,11 @@ async function startMatrixClient(startSyncing=true) {
|
|||
IntegrationManagers.sharedInstance().startWatching();
|
||||
ActiveWidgetStore.start();
|
||||
|
||||
// Start Mjolnir even though we haven't checked the feature flag yet. Starting
|
||||
// the thing just wastes CPU cycles, but should result in no actual functionality
|
||||
// being exposed to the user.
|
||||
Mjolnir.sharedInstance().start();
|
||||
|
||||
if (startSyncing) {
|
||||
await MatrixClientPeg.start();
|
||||
} else {
|
||||
|
@ -645,6 +651,7 @@ export function stopMatrixClient(unsetClient=true) {
|
|||
Presence.stop();
|
||||
ActiveWidgetStore.stop();
|
||||
IntegrationManagers.sharedInstance().stopWatching();
|
||||
Mjolnir.sharedInstance().stop();
|
||||
if (DMRoomMap.shared()) DMRoomMap.shared().stop();
|
||||
const cli = MatrixClientPeg.get();
|
||||
if (cli) {
|
||||
|
|
Loading…
Reference in a new issue