diff --git a/src/EventLogExpert/Store/EventLog/EventLogReducers.cs b/src/EventLogExpert/Store/EventLog/EventLogReducers.cs index db45ca40..aa709aa3 100644 --- a/src/EventLogExpert/Store/EventLog/EventLogReducers.cs +++ b/src/EventLogExpert/Store/EventLog/EventLogReducers.cs @@ -96,6 +96,11 @@ public static EventLogState ReduceSetContinouslyUpdate(EventLogState state, Even Events = state.NewEventBuffer.Events.Concat(state.Events).ToList().AsReadOnly(), NewEventBuffer = new(new List().AsReadOnly(), false) }; + + if (state.Watcher != null && !state.Watcher.IsWatching) + { + state.Watcher.StartWatching(); + } } return newState; diff --git a/src/EventLogExpert/Store/EventLog/LiveLogWatcher.cs b/src/EventLogExpert/Store/EventLog/LiveLogWatcher.cs index e95735b0..e68a90a3 100644 --- a/src/EventLogExpert/Store/EventLog/LiveLogWatcher.cs +++ b/src/EventLogExpert/Store/EventLog/LiveLogWatcher.cs @@ -64,9 +64,15 @@ public void StartWatching() } }; - _watcher.Enabled = true; + // When the watcher is enabled, it reads all the events since the + // last bookmark. Do this on a background thread so we don't tie + // up the UI. + Task.Run(() => + { + _watcher.Enabled = true; - _debugLogger.Trace("LiveLogWatcher started watching."); + _debugLogger.Trace("LiveLogWatcher started watching."); + }); } public void StopWatching()