[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:
Andy Zhao 2020-08-15 12:19:57 -04:00 committed by GitHub
parent 07a711a1cc
commit adc347580f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}`);
}
}