From 8679b3e0f5283e66817b489e457ba90357c85368 Mon Sep 17 00:00:00 2001 From: shadedred Date: Fri, 15 Nov 2024 22:52:06 -0800 Subject: [PATCH] store prelogin message when not logged in --- assets/chat/js/chat.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/chat/js/chat.js b/assets/chat/js/chat.js index 05293cc1..a5bc4dad 100644 --- a/assets/chat/js/chat.js +++ b/assets/chat/js/chat.js @@ -635,6 +635,13 @@ class Chat { .catch(() => {}); } + setPreLoginText() { + const chatText = ChatStore.read('chat.preLoginText') || ''; + this.input.val(chatText); + ChatStore.remove('chat.preLoginText'); + this.input.focus(); + } + setEmotes(emotes) { this.emoteService.setEmotes(emotes); this.emoteService @@ -1101,6 +1108,7 @@ class Chat { onME(data) { this.setUser(data); + this.setPreLoginText(); if (data) { // If is a logged in user. this.loadSettings(); @@ -1545,6 +1553,7 @@ class Chat { } // LOGIN else if (!this.authenticated) { + ChatStore.write('chat.preLoginText', raw); this.loginscrn.show(); } // WHISPER