agent changes
This commit is contained in:
@@ -69,7 +69,17 @@ export interface AssistantAnswer {
|
||||
*/
|
||||
export async function assistantAvailable(): Promise<boolean> {
|
||||
try {
|
||||
const status = await api.get<{ available?: boolean }>(`${WEB}/assistant/status`);
|
||||
const status = await api.get<{ available?: boolean; reason?: string }>(
|
||||
`${WEB}/assistant/status`,
|
||||
);
|
||||
// The reason goes to the browser console, never to the panel. It names
|
||||
// environment variables — useful to whoever deployed this, meaningless and
|
||||
// faintly alarming to a shopkeeper. "Not connected yet" stays the only
|
||||
// thing on screen; this is how somebody finds out which variable is wrong
|
||||
// without a redeploy to add logging.
|
||||
if (status?.available !== true && status?.reason) {
|
||||
console.warn(`[nearle] Buddy is off: ${status.reason}`);
|
||||
}
|
||||
return status?.available === true;
|
||||
} catch {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user