show popup when chat API returns an error

This commit is contained in:
Hazelnoot 2025-07-26 19:14:49 -04:00
parent ed68230811
commit 45212cbd56

View file

@ -194,8 +194,13 @@ function send() {
}).then(message => { }).then(message => {
clear(); clear();
}).catch(err => { }).catch(err => {
console.error(err); console.error('Error in chat:', err);
}).then(() => { return os.alert({
type: 'error',
title: i18n.ts.error,
text: String(err),
});
}).finally(() => {
sending.value = false; sending.value = false;
}); });
} else if (props.room) { } else if (props.room) {
@ -206,8 +211,13 @@ function send() {
}).then(message => { }).then(message => {
clear(); clear();
}).catch(err => { }).catch(err => {
console.error(err); console.error('Error in chat:', err);
}).then(() => { return os.alert({
type: 'error',
title: i18n.ts.error,
text: String(err),
});
}).finally(() => {
sending.value = false; sending.value = false;
}); });
} }