Loya says 'sign in again' instead of 'session expired'

This commit is contained in:
2026-09-19 15:29:15 +05:30
parent 01f1c17c7f
commit ae293dc095
3 changed files with 8 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Behavision</title>
<script type="module" crossorigin src="./assets/index-DKxK1S8I.js"></script>
<script type="module" crossorigin src="./assets/index-C-oYbwC6.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Z_jL3Bie.css">
</head>
<body>

View File

@@ -36,7 +36,12 @@ export default function Assistant({ session, onClose }) {
const a = await api.ask(history.map(t => ({ role: t.role, text: t.text })))
setTurns([...history, { role: 'assistant', text: a.text, used: a.used ?? [] }])
} catch (e) {
setError(message(e))
const m = message(e)
// Her only failure that is not hers: the login is gone. Say what to do,
// not "session expired" - the shell returns to Login within seconds.
setError(/session expired|unauthori[sz]ed/i.test(m)
? 'You’re signed out of head office, so I can’t look anything up. Sign in again and ask me once more.'
: m)
setTurns(turns) // the question stays in the box, not in the transcript
setDraft(q)
} finally { setBusy(false) }