Skip to content

Commit 80d5baf

Browse files
committed
fixed port update notification when there's no update
1 parent 0bc8d58 commit 80d5baf

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Avalonia.Desktop/Controls/CampaignsControl.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
</Grid>
3333

3434
<ListBox Name="CampaignsList"
35+
IsEnabled="{Binding !IsInProgress}"
3536
SelectionChanged="OnCampaignsListSelectionChanged"
3637
Grid.Row="1" Grid.Column="0"
3738
ScrollViewer.HorizontalScrollBarVisibility="Disabled"

src/Avalonia.Desktop/ViewModels/PortViewModel.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ public bool IsUpdateAvailable
136136
return false;
137137
}
138138

139+
if (_release is null)
140+
{
141+
return false;
142+
}
143+
139144
if (Port.PortEnum is PortEnum.NotBlood)
140145
{
141146
var r1 = DateTime.TryParse(
@@ -163,12 +168,9 @@ out currentVersion
163168
out var newVersion
164169
);
165170

166-
if (r1 && r2)
171+
if (r1 && r2 && currentVersion < newVersion)
167172
{
168-
if (currentVersion < newVersion)
169-
{
170-
return true;
171-
}
173+
return true;
172174
}
173175

174176
return false;

src/Ports/Providers/PortsReleasesProvider.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,5 @@ public PortsReleasesProvider(IApiInterface apiInterface)
4343
return hasRelease ? release : null;
4444
}
4545

46-
public async Task<Dictionary<PortEnum, GeneralReleaseEntity>?> GetReleasesAsync()
47-
{
48-
return await _apiInterface.GetLatestPortsReleasesAsync().ConfigureAwait(false);
49-
}
46+
public Task<Dictionary<PortEnum, GeneralReleaseEntity>?> GetReleasesAsync() => _apiInterface.GetLatestPortsReleasesAsync();
5047
}

0 commit comments

Comments
 (0)