diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-31 07:14:56 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-31 07:14:56 -0500 |
| commit | b2710e21202a2f2f7542d11d19f0cd5d20b5ebf2 (patch) | |
| tree | 2293c2dda302e5eaf5cc41c7efd3d05166828fc5 /pearl.el | |
| parent | 394c75b2f92e2a72390b3417e483849bed13a399 (diff) | |
| download | pearl-b2710e21202a2f2f7542d11d19f0cd5d20b5ebf2.tar.gz pearl-b2710e21202a2f2f7542d11d19f0cd5d20b5ebf2.zip | |
fix(accounts): pearl-check-setup reports the active account, not the legacy key
The setup check gated on pearl-api-key, which is normally unset once pearl-accounts is configured, so under multi-account it wrongly reported "API key is not set" and skipped the connection test even when the active account resolved a key fine. Under accounts mode it now resolves the active account's context, names it, and runs the test. An unusable setup (no default, missing key) reports the reason instead of signaling. Legacy single-account behavior is unchanged. The resolved key is never printed.
Diffstat (limited to 'pearl.el')
| -rw-r--r-- | pearl.el | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -5870,13 +5870,24 @@ resolves to a single label." ;;;###autoload (defun pearl-check-setup () - "Check if Linear.el is properly set up." + "Check if Pearl is properly set up, then test the connection. +Under accounts mode reports on the active account (resolving the default on +first need) rather than the legacy `pearl-api-key' global, which is normally +unset once `pearl-accounts' is configured." (interactive) - (if pearl-api-key - (progn - (message "API key is set (length: %d). Testing connection..." (length pearl-api-key)) - (pearl-test-connection)) - (message "Linear API key is not set. Use M-x customize-variable RET pearl-api-key"))) + (if pearl-accounts + (condition-case err + (let ((ctx (pearl--current-account-context))) + (message "Account %s is set up (key resolved). Testing connection..." + (plist-get ctx :name)) + (pearl-test-connection)) + (error (message "Pearl accounts are configured but not usable: %s" + (error-message-string err)))) + (if pearl-api-key + (progn + (message "API key is set (length: %d). Testing connection..." (length pearl-api-key)) + (pearl-test-connection)) + (message "Linear API key is not set. Use M-x customize-variable RET pearl-api-key")))) ;;;###autoload (defun pearl-load-api-key-from-env () |
