show popup when chat API returns an error
This commit is contained in:
parent
ed68230811
commit
45212cbd56
1 changed files with 14 additions and 4 deletions
|
|
@ -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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue