From 6163a6dd7760e46f3fa5b38888ce26e861f0ffc1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 31 May 2019 11:13:46 -0400 Subject: [PATCH] fix slider history saves --- .../GeneratorHistoryPageViewModel.cs | 1 + src/App/Pages/Generator/GeneratorPage.xaml | 2 +- src/App/Pages/Generator/GeneratorPage.xaml.cs | 9 +---- .../Pages/Generator/GeneratorPageViewModel.cs | 37 ++++--------------- 4 files changed, 12 insertions(+), 37 deletions(-) diff --git a/src/App/Pages/Generator/GeneratorHistoryPageViewModel.cs b/src/App/Pages/Generator/GeneratorHistoryPageViewModel.cs index ad7f59195..b3c88acb2 100644 --- a/src/App/Pages/Generator/GeneratorHistoryPageViewModel.cs +++ b/src/App/Pages/Generator/GeneratorHistoryPageViewModel.cs @@ -45,6 +45,7 @@ namespace Bit.App.Pages public async Task ClearAsync() { History.ResetWithRange(new List()); + ShowNoData = true; await _passwordGenerationService.ClearAsync(); } diff --git a/src/App/Pages/Generator/GeneratorPage.xaml b/src/App/Pages/Generator/GeneratorPage.xaml index 63faa575b..72e64c08d 100644 --- a/src/App/Pages/Generator/GeneratorPage.xaml +++ b/src/App/Pages/Generator/GeneratorPage.xaml @@ -105,7 +105,7 @@ VerticalOptions="CenterAndExpand" HorizontalTextAlignment="End" /> - { - await Task.Delay(500); - if(DateTime.UtcNow - page.LastLengthSliderChange < TimeSpan.FromMilliseconds(450)) - { - return; - } - else - { - previousCts?.Cancel(); - } - cts.Token.ThrowIfCancellationRequested(); - await _passwordGenerationService.SaveOptionsAsync(_options); - cts.Token.ThrowIfCancellationRequested(); - await _passwordGenerationService.AddHistoryAsync(Password, cts.Token); - }, cts.Token); - _sliderCancellationTokenSource = cts; } public async Task CopyAsync()