fix: (regression 0.47.0) double "invalid credentials" message on login

Massimo Melina committed Jul 22, 2023 at 14:47 UTC b5c5285af22ec8d36690ec89500e8b1288422c22
1 file changed +6 -3
frontend/src/dialog.ts
+6 -3
@@ -76,9 +76,12 @@ export function alertDialog(msg: ReactElement | string | Error, type:AlertType='
76 }))
77
78 function Content(){
79 - if (msg instanceof Error)
80 - msg = h('div', {}, err2msg(msg),
81 - h('div', { style: { marginTop: 20, fontSize: 'small' } }, msg.message) )
79 + if (msg instanceof Error) {
80 + const main = err2msg(msg)
81 + const sub = msg.message
82 + msg = h('div', {}, main,
83 + sub !== main && h('div', { style: { marginTop: 20, fontSize: 'small' } }, sub))
84 + }
85 if (typeof msg === 'string')
86 msg = h('p', {}, msg)
87 return msg