mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fixed: fixed KeyNotFoundException and improvement
This commit is contained in:
parent
c75cb1acec
commit
37c733789e
2 changed files with 6 additions and 8 deletions
|
|
@ -122,8 +122,8 @@ public class TabsReservationService : IDisposable
|
|||
_tabsTracker.MakeSnapshot();
|
||||
|
||||
int expectedIndex = Math.Max(tokenHandling.LastReturnedIndex, token.Index) + 1;
|
||||
var tab = _tabsTracker.TryGetTab(expectedIndex, out var foundInTrackingInfo);
|
||||
trackingInfo = foundInTrackingInfo;
|
||||
var (tab, info) = _tabsTracker.TryGetTab(expectedIndex);
|
||||
trackingInfo = info;
|
||||
if (tab != null)
|
||||
{
|
||||
if (tokenHandling.RequestedStill <= 1)
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ public class TabsTracker : IDisposable
|
|||
List<AutomationElement> elementsToInvalidate;
|
||||
lock (_syncInvalidations)
|
||||
{
|
||||
elementsToInvalidate = [.. _structureInvalidations];
|
||||
elementsToInvalidate = _structureInvalidations.Where(_browserWindowsTracked.ContainsKey).ToList();
|
||||
_structureInvalidations.Clear();
|
||||
}
|
||||
foreach (var element in elementsToInvalidate)
|
||||
|
|
@ -307,7 +307,7 @@ public class TabsTracker : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
public AutomationElement TryGetTab(int expectedIndex, out TrackingInfo foundInTrackingInfo)
|
||||
public (AutomationElement, TrackingInfo) TryGetTab(int expectedIndex)
|
||||
{
|
||||
lock (_sync)
|
||||
{
|
||||
|
|
@ -316,12 +316,10 @@ public class TabsTracker : IDisposable
|
|||
var tab = trackingInfo.Cache.TryGetTab(expectedIndex);
|
||||
if (tab != null)
|
||||
{
|
||||
foundInTrackingInfo = trackingInfo;
|
||||
return tab;
|
||||
return (tab, trackingInfo);
|
||||
}
|
||||
}
|
||||
foundInTrackingInfo = null;
|
||||
return null;
|
||||
return (null, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue