From 0de7e90bcb0bb2ce559c938c87714b87846e21e5 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Thu, 8 Oct 2020 23:02:09 +0800 Subject: [PATCH] client: ensure stores are loaded before starting activity stream --- client/src/javascript/actions/FloodActions.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/javascript/actions/FloodActions.ts b/client/src/javascript/actions/FloodActions.ts index 91d66ef6..65ab415f 100644 --- a/client/src/javascript/actions/FloodActions.ts +++ b/client/src/javascript/actions/FloodActions.ts @@ -194,6 +194,13 @@ const FloodActions = { // If the user requested a new history snapshot, or the event source has not // alraedy been created, we open the event stream. if (didHistorySnapshotChange || activityStreamEventSource == null) { + import(/* webpackPrefetch: true */ '../stores/ClientStatusStore'); + import(/* webpackPrefetch: true */ '../stores/DiskUsageStore'); + import(/* webpackPrefetch: true */ '../stores/NotificationStore'); + import(/* webpackPrefetch: true */ '../stores/TorrentStore'); + import(/* webpackPrefetch: true */ '../stores/TorrentFilterStore'); + import(/* webpackPrefetch: true */ '../stores/TransferDataStore'); + import(/* webpackPrefetch: true */ '../stores/UIStore'); activityStreamEventSource = new EventSource(`${baseURI}api/activity-stream?historySnapshot=${historySnapshot}`); Object.entries(ServerEventHandlers).forEach(([event, handler]) => {