Skip to content

Commit 556e060

Browse files
committed
#22 - Only add last entry to history if port was found
1 parent d67cabe commit 556e060

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

Source/NETworkManager/ViewModels/Applications/WikiViewModel.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ private async void PortLookupAction()
262262
{
263263
if ((startPort > 0) && (startPort < 65536) && (endPort > 0) && (endPort < 65536) && (startPort < endPort))
264264
{
265-
for (int i = startPort; i < endPort +1; i++)
265+
for (int i = startPort; i < endPort + 1; i++)
266266
{
267267
ports.Add(i);
268268
}
269-
}
269+
}
270270
else
271271
{
272272
portsByService.Add(portOrService1);
@@ -299,16 +299,22 @@ private async void PortLookupAction()
299299
PortLookupResult.Add(info);
300300
}
301301

302-
foreach(PortLookupInfo info in await PortLookup.LookupByServiceAsync(portsByService))
302+
foreach (PortLookupInfo info in await PortLookup.LookupByServiceAsync(portsByService))
303303
{
304304
PortLookupResult.Add(info);
305305
}
306-
307-
PortsHistory = new List<string>(HistoryListHelper.Modify(PortsHistory, PortsOrService, SettingsManager.Current.Application_HistoryListEntries));
308306

309-
IsPortLookupRunning = false;
307+
if (PortLookupResult.Count == 0)
308+
{
309+
NoPortsFound = true;
310+
}
311+
else
312+
{
313+
PortsHistory = new List<string>(HistoryListHelper.Modify(PortsHistory, PortsOrService, SettingsManager.Current.Application_HistoryListEntries));
314+
NoPortsFound = false;
315+
}
310316

311-
NoPortsFound = PortLookupResult.Count == 0;
317+
IsPortLookupRunning = false;
312318
}
313319
#endregion
314320
}

0 commit comments

Comments
 (0)