mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-29 21:17:17 +00:00
15 lines
365 B
JavaScript
15 lines
365 B
JavaScript
import "@hotwired/turbo";
|
|
|
|
document.addEventListener("turbo:frame-missing", (event) => {
|
|
// don't replace frame contents
|
|
event.preventDefault();
|
|
|
|
// show error message instead
|
|
status = event.detail.response.status;
|
|
if(status == 401) {
|
|
alert(I18n.t("errors.unauthorized.message"));
|
|
} else {
|
|
alert(I18n.t("errors.general_error.message"));
|
|
}
|
|
});
|