Skip to content

Commit

Permalink
store prelogin message when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
shadedred committed Nov 16, 2024
1 parent c86d965 commit 8679b3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions assets/chat/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1101,6 +1108,7 @@ class Chat {

onME(data) {
this.setUser(data);
this.setPreLoginText();
if (data) {
// If is a logged in user.
this.loadSettings();
Expand Down Expand Up @@ -1545,6 +1553,7 @@ class Chat {
}
// LOGIN
else if (!this.authenticated) {
ChatStore.write('chat.preLoginText', raw);
this.loginscrn.show();
}
// WHISPER
Expand Down

0 comments on commit 8679b3e

Please sign in to comment.