Skip to content

Commit 6317d0e

Browse files
committed
Reload on all settings change
1 parent eb81f71 commit 6317d0e

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Flow.Launcher.Infrastructure/PinyinAlphabet.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,17 @@ 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+
Reload();
32+
break;
33+
case nameof(Settings.UseDoublePinyin):
34+
Reload();
35+
break;
36+
case nameof(Settings.DoublePinyinSchema):
37+
Reload();
38+
break;
3239
}
3340
};
3441
}

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)