mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 19:26:04 +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 SettingsStore from "./settings/SettingsStore";
|
||||||
import TypingStore from "./stores/TypingStore";
|
import TypingStore from "./stores/TypingStore";
|
||||||
import {IntegrationManagers} from "./integrations/IntegrationManagers";
|
import {IntegrationManagers} from "./integrations/IntegrationManagers";
|
||||||
|
import {Mjolnir} from "./mjolnir/Mjolnir";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called at startup, to attempt to build a logged-in Matrix session. It tries
|
* 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();
|
IntegrationManagers.sharedInstance().startWatching();
|
||||||
ActiveWidgetStore.start();
|
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) {
|
if (startSyncing) {
|
||||||
await MatrixClientPeg.start();
|
await MatrixClientPeg.start();
|
||||||
} else {
|
} else {
|
||||||
|
@ -645,6 +651,7 @@ export function stopMatrixClient(unsetClient=true) {
|
||||||
Presence.stop();
|
Presence.stop();
|
||||||
ActiveWidgetStore.stop();
|
ActiveWidgetStore.stop();
|
||||||
IntegrationManagers.sharedInstance().stopWatching();
|
IntegrationManagers.sharedInstance().stopWatching();
|
||||||
|
Mjolnir.sharedInstance().stop();
|
||||||
if (DMRoomMap.shared()) DMRoomMap.shared().stop();
|
if (DMRoomMap.shared()) DMRoomMap.shared().stop();
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
if (cli) {
|
if (cli) {
|
||||||
|
|
Loading…
Reference in a new issue