web: only show message on server error

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-03-29 17:36:52 +02:00
parent dfff2a1134
commit fc17580d9a

View file

@ -6,7 +6,7 @@ import { showMessage } from "./MessageContainer";
export class MessageMiddleware implements Middleware { export class MessageMiddleware implements Middleware {
post(context: ResponseContext): Promise<Response | void> { post(context: ResponseContext): Promise<Response | void> {
if (!context.response.ok) { if (context.response.status >= 500) {
showMessage({ showMessage({
level: MessageLevel.error, level: MessageLevel.error,
message: gettext("API request failed"), message: gettext("API request failed"),