Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ private async Task HandlePortalChanged()
await UpdateBasemaps();
}

private readonly SemaphoreSlim _updateBasemapsSemaphore = new(1, 1);

public async Task UpdateBasemaps()
{
await _updateBasemapsSemaphore.WaitAsync();
try
{
IsLoading = true;
// Cancel any pending load before starting a new one
_loadCancellationTokenSource?.Cancel();
Expand All @@ -217,6 +222,11 @@ public async Task UpdateBasemaps()
IsLoading = false;
}
}
finally
{
_updateBasemapsSemaphore.Release();
}
}

private void HandleSelectedBasemapChanged()
{
Expand Down
Loading