Loya says 'sign in again' instead of 'session expired'
This commit is contained in:
File diff suppressed because one or more lines are too long
2
desktop/frontend/dist/index.html
vendored
2
desktop/frontend/dist/index.html
vendored
@@ -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>
|
||||
|
||||
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user