web: optionally allow unique messages

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-11-16 11:21:30 +01:00
parent 638e8d741f
commit 047030f901
2 changed files with 16 additions and 7 deletions

View File

@ -33,10 +33,13 @@ export class WebsocketClient {
this.messageSocket.addEventListener("close", (e) => {
console.debug(`authentik/ws: closed ws connection: ${e}`);
if (this.retryDelay > 3000) {
showMessage({
level: MessageLevel.error,
message: t`Connection error, reconnecting...`,
});
showMessage(
{
level: MessageLevel.error,
message: t`Connection error, reconnecting...`,
},
true,
);
}
setTimeout(() => {
console.debug(`authentik/ws: reconnecting ws in ${this.retryDelay}ms`);