Skip to content

Commit 207355e

Browse files
authored
Merge pull request #3830 from Flow-Launcher/double_pin_rework
Reload on all settings change
2 parents eb81f71 + 8c56c0b commit 207355e

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

Flow.Launcher.Infrastructure/PinyinAlphabet.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,21 @@ public PinyinAlphabet()
2525

2626
_settings.PropertyChanged += (sender, e) =>
2727
{
28-
if (e.PropertyName == nameof(Settings.UseDoublePinyin) ||
29-
e.PropertyName == nameof(Settings.DoublePinyinSchema))
28+
switch (e.PropertyName)
3029
{
31-
Reload();
30+
case nameof (Settings.ShouldUsePinyin):
31+
if (_settings.ShouldUsePinyin)
32+
{
33+
Reload();
34+
}
35+
break;
36+
case nameof(Settings.UseDoublePinyin):
37+
case nameof(Settings.DoublePinyinSchema):
38+
if (_settings.UseDoublePinyin)
39+
{
40+
Reload();
41+
}
42+
break;
3243
}
3344
};
3445
}

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,19 @@ public CustomBrowserViewModel CustomBrowser
328328
/// <summary>
329329
/// when false Alphabet static service will always return empty results
330330
/// </summary>
331-
public bool ShouldUsePinyin { get; set; } = false;
331+
private bool _useAlphabet = true;
332+
public bool ShouldUsePinyin
333+
{
334+
get => _useAlphabet;
335+
set
336+
{
337+
if (_useAlphabet != value)
338+
{
339+
_useAlphabet = value;
340+
OnPropertyChanged();
341+
}
342+
}
343+
}
332344

333345
private bool _useDoublePinyin = false;
334346
public bool UseDoublePinyin

0 commit comments

Comments
 (0)