diff --git a/UI/ChatSignalR/UnoChat.Client/UnoChat.Shared/ViewModel.cs b/UI/ChatSignalR/UnoChat.Client/UnoChat.Shared/ViewModel.cs index 2635662d..29128d17 100644 --- a/UI/ChatSignalR/UnoChat.Client/UnoChat.Shared/ViewModel.cs +++ b/UI/ChatSignalR/UnoChat.Client/UnoChat.Shared/ViewModel.cs @@ -209,7 +209,6 @@ namespace UnoChat.Client private IDisposable ShouldSendModelsAddedToAllMessagesToMessageObserver(IObserver messageObserver) { -#if !__WASM__ return Observable .FromEvent( handler => (s, e) => handler(e), @@ -218,24 +217,11 @@ namespace UnoChat.Client .Where(args => args.Action == NotifyCollectionChangedAction.Add) .Select(args => args.NewItems.OfType().FirstOrDefault()) .Where(model => model != null) - #if !__WASM__ .Delay(TimeSpan.FromMilliseconds(10), Schedulers.Default) // Wait for the list view to have been updated #endif .ObserveOn(Schedulers.Dispatcher) .Subscribe(messageObserver); -#else - return Observable - .FromEvent( - handler => (s, e) => handler(e), - handler => _allMessages.CollectionChanged += handler, - handler => _allMessages.CollectionChanged -= handler) - .Where(args => args.Action == NotifyCollectionChangedAction.Add) - .Select(args => args.NewItems.OfType().FirstOrDefault()) - .Where(model => model != null) - .ObserveOn(Schedulers.Dispatcher) - .Subscribe(messageObserver); -#endif } public IDisposable Activate(IObservable messageToSendBoxReturn, IObserver themeObserver, IObserver messageObserver)