Skip to content

Commit 750cba2

Browse files
committed
Fix search delay runtime change issue
1 parent 2273d0c commit 750cba2

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,17 @@ public bool SearchQueryResultsWithDelay
330330
OnPropertyChanged();
331331
}
332332
}
333-
public int SearchDelay { get; set; } = 120;
333+
334+
int searchDelay { get; set; } = 120;
335+
public int SearchDelay
336+
{
337+
get => searchDelay;
338+
set
339+
{
340+
searchDelay = value;
341+
OnPropertyChanged();
342+
}
343+
}
334344

335345
[JsonIgnore]
336346
public List<int> SearchDelayRange { get; } = new()

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private async void OnLoaded(object sender, RoutedEventArgs _)
123123
}
124124

125125
// Initialize search delay
126-
SetupSearchTextBoxReactiveness(_settings.SearchQueryResultsWithDelay);
126+
SetupSearchTextBoxReactiveness(_settings.SearchQueryResultsWithDelay, _settings.SearchDelay);
127127

128128
// Initialize place holder
129129
SetupPlaceholderText();
@@ -268,7 +268,13 @@ private async void OnLoaded(object sender, RoutedEventArgs _)
268268
SetupResizeMode();
269269
break;
270270
case nameof(Settings.SearchQueryResultsWithDelay):
271-
SetupSearchTextBoxReactiveness(_settings.SearchQueryResultsWithDelay);
271+
SetupSearchTextBoxReactiveness(_settings.SearchQueryResultsWithDelay, _settings.SearchDelay);
272+
break;
273+
case nameof(Settings.SearchDelay):
274+
if (_settings.SearchQueryResultsWithDelay)
275+
{
276+
SetupSearchTextBoxReactiveness(_settings.SearchQueryResultsWithDelay, _settings.SearchDelay);
277+
}
272278
break;
273279
}
274280
};
@@ -1122,7 +1128,7 @@ private void SetupResizeMode()
11221128

11231129
// Edited from: https://github.com/microsoft/PowerToys
11241130

1125-
private void SetupSearchTextBoxReactiveness(bool showResultsWithDelay)
1131+
private void SetupSearchTextBoxReactiveness(bool showResultsWithDelay, int searchDelay)
11261132
{
11271133
if (_reactiveSubscription != null)
11281134
{

0 commit comments

Comments
 (0)