Skip to content

Commit 4037a3c

Browse files
committed
Fix info bar appearing in file comparison
1 parent c4441bf commit 4037a3c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/Files.App/ViewModels/Properties/HashesViewModel.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Files Community
1+
// Copyright (c) Files Community
22
// Licensed under the MIT License.
33

44
using Files.Shared.Helpers;
@@ -39,9 +39,8 @@ public string HashInput
3939
set
4040
{
4141
SetProperty(ref _hashInput, value);
42-
43-
OnPropertyChanged(nameof(IsInfoBarOpen));
4442
OnHashInputTextChanged();
43+
IsInfoBarOpen = !string.IsNullOrEmpty(value);
4544
}
4645
}
4746

@@ -62,7 +61,7 @@ public string InfoBarTitle
6261
private bool _isInfoBarOpen;
6362
public bool IsInfoBarOpen
6463
{
65-
get => !string.IsNullOrEmpty(HashInput);
64+
get => _isInfoBarOpen;
6665
set => SetProperty(ref _isInfoBarOpen, value);
6766
}
6867

@@ -238,14 +237,14 @@ private void OnHashInputTextChanged()
238237
{
239238
InfoBarSeverity = InfoBarSeverity.Error;
240239
InfoBarTitle = Strings.HashesDoNotMatch.GetLocalizedResource();
241-
IsInfoBarOpen = true;
242240
}
243241
else
244242
{
245243
InfoBarSeverity = InfoBarSeverity.Success;
246244
InfoBarTitle = string.Format(Strings.HashesMatch.GetLocalizedResource(), matchingAlgorithm);
247-
IsInfoBarOpen = true;
248245
}
246+
247+
IsInfoBarOpen = true;
249248
}
250249

251250
private async Task OnCompareFileAsync()
@@ -254,12 +253,12 @@ private async Task OnCompareFileAsync()
254253

255254
if (result)
256255
{
257-
InfoBarSeverity = InfoBarSeverity.Success; // Check mark
256+
InfoBarSeverity = InfoBarSeverity.Success;
258257
InfoBarTitle = Strings.HashesMatch.GetLocalizedResource();
259258
}
260259
else
261260
{
262-
InfoBarSeverity = InfoBarSeverity.Error; // Cross mark
261+
InfoBarSeverity = InfoBarSeverity.Error;
263262
InfoBarTitle = Strings.HashesDoNotMatch.GetLocalizedResource();
264263
}
265264

0 commit comments

Comments
 (0)