diff --git a/src/shell-network-agent.c b/src/shell-network-agent.c
index 10f8d91..2562ebc 100644
--- a/src/shell-network-agent.c
+++ b/src/shell-network-agent.c
@@ -263,15 +263,15 @@ get_secrets_keyring_cb (GObject            *source,
                         gpointer            user_data)
 {
   ShellAgentRequest *closure;
   ShellNetworkAgent *self;
   ShellNetworkAgentPrivate *priv;
   GError *secret_error = NULL;
   GError *error = NULL;
-  gint n_found = 0;
+  gboolean secrets_found = FALSE;
   GList *items;
   GList *l;
   GHashTable *outer;
 
   items = secret_service_search_finish (NULL, result, &secret_error);
 
   if (g_error_matches (secret_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
@@ -323,32 +323,28 @@ get_secrets_keyring_cb (GObject            *source,
                   g_value_set_string (secret_value, secret_value_get (secret, NULL));
 
                   g_hash_table_insert (closure->entries, secret_name, secret_value);
                 }
               else
                 g_hash_table_insert (closure->vpn_entries, secret_name, g_strdup (secret_value_get (secret, NULL)));
 
-              if (closure->hints)
-                n_found += strv_has (closure->hints, secret_name);
-              else
-                n_found += 1;
-
+              secrets_found = TRUE;
               g_hash_table_unref (attributes);
               secret_value_unref (secret);
               break;
             }
         }
 
       g_hash_table_unref (attributes);
       secret_value_unref (secret);
     }
 
   g_list_free_full (items, g_object_unref);
 
-  if (n_found == 0 &&
+  if (secrets_found == FALSE &&
       (closure->flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION))
     {
       nm_connection_update_secrets (closure->connection, closure->setting_name, closure->entries, NULL);
 
       request_secrets_from_ui (closure);
       return;
     }
