From fc17580d9afb40f1cc393c015a18cf167c626a0b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 29 Mar 2021 17:36:52 +0200 Subject: [PATCH] web: only show message on server error Signed-off-by: Jens Langhammer --- web/src/elements/messages/Middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/elements/messages/Middleware.ts b/web/src/elements/messages/Middleware.ts index b01861950..320cdc74f 100644 --- a/web/src/elements/messages/Middleware.ts +++ b/web/src/elements/messages/Middleware.ts @@ -6,7 +6,7 @@ import { showMessage } from "./MessageContainer"; export class MessageMiddleware implements Middleware { post(context: ResponseContext): Promise { - if (!context.response.ok) { + if (context.response.status >= 500) { showMessage({ level: MessageLevel.error, message: gettext("API request failed"),