mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[cmdpal] Add some logs for WinGet extension (#39329)
This commit is contained in:
@@ -156,7 +156,22 @@ public partial class InstallPackageListItem : ListItem
|
|||||||
|
|
||||||
private async void UpdatedInstalledStatus()
|
private async void UpdatedInstalledStatus()
|
||||||
{
|
{
|
||||||
var status = await _package.CheckInstalledStatusAsync();
|
try
|
||||||
|
{
|
||||||
|
var status = await _package.CheckInstalledStatusAsync();
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
// DO NOTHING HERE
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Handle other exceptions
|
||||||
|
ExtensionHost.LogMessage($"[WinGet] UpdatedInstalledStatus throw exception: {ex.Message}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var isInstalled = _package.InstalledVersion != null;
|
var isInstalled = _package.InstalledVersion != null;
|
||||||
|
|
||||||
var installedState = isInstalled ?
|
var installedState = isInstalled ?
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ internal sealed partial class WinGetExtensionPage : DynamicListPage, IDisposable
|
|||||||
{
|
{
|
||||||
// emptySearchForTag ===
|
// emptySearchForTag ===
|
||||||
// we don't have results yet, we haven't typed anything, and we're searching for a tag
|
// we don't have results yet, we haven't typed anything, and we're searching for a tag
|
||||||
bool emptySearchForTag = _results == null &&
|
var emptySearchForTag = _results == null &&
|
||||||
string.IsNullOrEmpty(SearchText) &&
|
string.IsNullOrEmpty(SearchText) &&
|
||||||
HasTag;
|
HasTag;
|
||||||
|
|
||||||
@@ -116,8 +116,22 @@ internal sealed partial class WinGetExtensionPage : DynamicListPage, IDisposable
|
|||||||
|
|
||||||
IsLoading = true;
|
IsLoading = true;
|
||||||
|
|
||||||
// Save the latest search task
|
try
|
||||||
_currentSearchTask = DoSearchAsync(newSearch, cancellationToken);
|
{
|
||||||
|
// Save the latest search task
|
||||||
|
_currentSearchTask = DoSearchAsync(newSearch, cancellationToken);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException)
|
||||||
|
{
|
||||||
|
// DO NOTHING HERE
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// Handle other exceptions
|
||||||
|
ExtensionHost.LogMessage($"[WinGet] DoUpdateSearchText throw exception: {ex.Message}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Await the task to ensure only the latest one gets processed
|
// Await the task to ensure only the latest one gets processed
|
||||||
_ = ProcessSearchResultsAsync(_currentSearchTask, newSearch);
|
_ = ProcessSearchResultsAsync(_currentSearchTask, newSearch);
|
||||||
|
|||||||
Reference in New Issue
Block a user