Skip to content

Commit 4c24bdb

Browse files
committed
Chore: Copilot feedback
1 parent feab146 commit 4c24bdb

7 files changed

Lines changed: 10 additions & 17 deletions

‎Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Threading.Tasks;
1+
using System.Threading.Tasks;
22
using System.Windows.Input;
33
using NETworkManager.Models.IPApi;
44
using NETworkManager.Settings;
@@ -55,6 +55,7 @@ private set
5555
public IPApiDNSResolverWidgetViewModel()
5656
{
5757
LoadSettings();
58+
Check();
5859
}
5960

6061
/// <summary>
@@ -81,7 +82,7 @@ private void LoadSettings()
8182
/// <summary>
8283
/// Checks the DNS resolver.
8384
/// </summary>
84-
public void Check()
85+
private void Check()
8586
{
8687
_ = CheckAsync();
8788
}
@@ -98,7 +99,7 @@ private async Task CheckAsync()
9899
IsRunning = true;
99100
Result = null;
100101

101-
// Make the user happy, let him see a reload animation (and he cannot spam the reload command)
102+
// Make the user happy, let him see a reload animation (and he cannot spam the reload command)
102103
await Task.Delay(GlobalStaticConfiguration.ApplicationUIRefreshInterval);
103104

104105
Result = await DNSResolverService.GetInstance().GetDNSResolverAsync();

‎Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private set
5858
public IPApiIPGeolocationWidgetViewModel()
5959
{
6060
LoadSettings();
61+
Check();
6162
}
6263

6364
/// <summary>
@@ -83,7 +84,7 @@ private void LoadSettings()
8384
/// <summary>
8485
/// Checks the IP geolocation.
8586
/// </summary>
86-
public void Check()
87+
private void Check()
8788
{
8889
_ = CheckAsync();
8990
}

‎Source/NETworkManager/ViewModels/NetworkConnectionWidgetViewModel.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ private set
502502
public NetworkConnectionWidgetViewModel()
503503
{
504504
LoadSettings();
505+
Check();
505506
}
506507

507508
/// <summary>
@@ -587,6 +588,7 @@ private async Task CheckAsync()
587588
finally
588589
{
589590
IsChecking = false;
591+
_cancellationTokenSource.Dispose();
590592

591593
if (!wasCanceled)
592594
Log.Info("Network connection check completed.");

‎Source/NETworkManager/Views/DashboardView.xaml.cs‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ public DashboardView()
2222
ContentControlIPApiIPGeolocation.Content = _ipApiIPGeolocationWidgetView;
2323
ContentControlIPApiDNSResolver.Content = _ipApiDNSResolverWidgetView;
2424
ContentControlSpeedTest.Content = _speedTestWidgetView;
25-
26-
// Check all widgets
27-
_networkConnectionWidgetView.Check();
28-
_ipApiIPGeolocationWidgetView.Check();
29-
_ipApiDNSResolverWidgetView.Check();
3025
}
3126

3227
public void OnViewVisible()

‎Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml.cs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
using NETworkManager.ViewModels;
23

34
namespace NETworkManager.Views;
@@ -12,8 +13,4 @@ public IPApiDNSResolverWidgetView()
1213
DataContext = _viewModel;
1314
}
1415

15-
public void Check()
16-
{
17-
_viewModel.Check();
18-
}
1916
}

‎Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml.cs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,4 @@ public IPApiIPGeolocationWidgetView()
1212
DataContext = _viewModel;
1313
}
1414

15-
public void Check()
16-
{
17-
_viewModel.Check();
18-
}
1915
}

‎Website/docs/changelog/next-release.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Release date: **xx.xx.2025**
6767

6868
**Dashboard**
6969

70+
- Added a **Refresh** button (with animated feedback) to the **Network Connection**, **IP Geolocation**, and **DNS Resolver** widgets. The global reload button in the Status Window has been removed, as each widget now has its own. [#3447](https://github.com/BornToBeRoot/NETworkManager/pull/3447)
7071
- Redesign Status Window to make it more compact. [#3359](https://github.com/BornToBeRoot/NETworkManager/pull/3359)
7172

7273
**Network Interface**

0 commit comments

Comments
 (0)