From 3cd63570dc0997acd79b150c98607e4afbc17fe9 Mon Sep 17 00:00:00 2001 From: Geoffrey Allott Date: Sun, 14 Mar 2021 01:23:02 +0000 Subject: [PATCH] show some "ProtocolError" error messages to user --- site/modules/socket.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/site/modules/socket.js b/site/modules/socket.js index a610ac1..d0bd1de 100644 --- a/site/modules/socket.js +++ b/site/modules/socket.js @@ -104,6 +104,16 @@ export class Socket { this.show_login(); this.state = "Connected"; break; + case "ProtocolError": + switch (this.state) { + case "LoginSent": + this.show_login(message.reason); + break; + case "CreateUserSent": + this.show_create_user(message.reason); + break; + } + break; } } @@ -150,6 +160,7 @@ export class Socket { this.show_create_user("Passwords do not match"); } else { this.send(new Auth(username, password).create_user_message()); + this.state = "CreateUserSent"; } }; } -- 2.34.1