Skip to content

Commit

Permalink
Merge pull request #561 from shadedred/store-prelogin
Browse files Browse the repository at this point in the history
store prelogin message when not logged in
  • Loading branch information
11k authored Nov 24, 2024
2 parents 2fc3fab + ebb7487 commit 5db439a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assets/chat/js/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,15 @@ class Chat {
.catch(() => {});
}

setPreLoginText() {
const chatText = ChatStore.read('chat.preLoginText');
if (chatText === null) {
return;
}
this.input.val(chatText);
ChatStore.remove('chat.preLoginText');
}

setEmotes(emotes) {
this.emoteService.setEmotes(emotes);
this.emoteService
Expand Down Expand Up @@ -1098,6 +1107,7 @@ class Chat {

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

0 comments on commit 5db439a

Please sign in to comment.