mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
[AdvancedPaste]Hide custom actions on Paste menu when Paste with AI disabled (#35047)
This commit is contained in:
@@ -142,13 +142,13 @@ private:
|
||||
{
|
||||
try
|
||||
{
|
||||
winrt::Windows::Security::Credentials::PasswordVault vault;
|
||||
return vault.Retrieve(OPENAI_VAULT_RESOURCE, OPENAI_VAULT_USERNAME) != nullptr;
|
||||
winrt::Windows::Security::Credentials::PasswordVault().Retrieve(OPENAI_VAULT_RESOURCE, OPENAI_VAULT_USERNAME);
|
||||
return true;
|
||||
}
|
||||
catch (const winrt::hresult_error& ex)
|
||||
{
|
||||
// Looks like the only way to access the PasswordVault is through the an API that throws an exception in case the resource doesn't exist.
|
||||
// If the compiler breaks here when you're debugging, just continue.
|
||||
// If the debugger breaks here, just continue.
|
||||
// If you want to disable breaking here in a more permanent way, just add a condition in Visual Studio's Exception Settings to not break on win::hresult_error, but that might make you not hit other exceptions you might want to catch.
|
||||
if (ex.code() == HRESULT_FROM_WIN32(ERROR_NOT_FOUND))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user