[deploy] Add error handling for comment mod page reactions (#9806)
* Add error handling for comment mod page reactions * Use alert instead of snackbar
This commit is contained in:
parent
07a711a1cc
commit
adc347580f
1 changed files with 7 additions and 2 deletions
|
|
@ -33,12 +33,17 @@ async function updateMainReactions(reactableType, category, reactableId) {
|
|||
|
||||
if (outcome.result === 'create') {
|
||||
clickedBtn.classList.add('reacted');
|
||||
} else {
|
||||
} else if (outcome.result === 'destroy') {
|
||||
clickedBtn.classList.remove('reacted');
|
||||
} else {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert(`Error: ${outcome.error}`);
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`Error: ${outcome.error}`);
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert(error);
|
||||
alert(`Error: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue