diff --git a/client/src/components/guest.top.jsx b/client/src/components/guest.top.jsx
index f356356c..c6020b6f 100644
--- a/client/src/components/guest.top.jsx
+++ b/client/src/components/guest.top.jsx
@@ -100,25 +100,23 @@ function Play(args) {
const list = () => {
return (
-
-
-
-
- Learn MNML
-
-
-
- Join the Community
-
-
+
+
+
+ Learn MNML
+
+
+
+ Join the Community
+
);
};
@@ -127,8 +125,9 @@ function Play(args) {
Welcome to MNML
- {news}
{list()}
+
+ {news}
diff --git a/client/src/events.jsx b/client/src/events.jsx
index c0b935b1..dbf1c1bf 100644
--- a/client/src/events.jsx
+++ b/client/src/events.jsx
@@ -104,6 +104,10 @@ function registerEvents(store) {
}
function setAccount(account) {
+ store.dispatch(actions.setAccount(account));
+ }
+
+ function setAuthenticated(account) {
if (account && window.Notification) {
window.Notification.requestPermission();
}
@@ -113,6 +117,7 @@ function registerEvents(store) {
}
store.dispatch(actions.setAccount(account));
+ store.dispatch(actions.setAuthenticated(true));
}
function setEmail(email) {
@@ -223,6 +228,7 @@ function registerEvents(store) {
clearTutorial,
clearTutorialGame,
setAccount,
+ setAuthenticated,
setAccountInstances,
setActiveItem,
setActiveSkill,
diff --git a/client/src/socket.jsx b/client/src/socket.jsx
index 443235ae..30e16b59 100644
--- a/client/src/socket.jsx
+++ b/client/src/socket.jsx
@@ -270,7 +270,7 @@ function createSocket(events) {
// this object wraps the reply types to a function
const handlers = {
AccountState: onAccount,
- AccountAuthenticated: events.setAuthenticated,
+ AccountAuthenticated: account => events.setAuthenticated(account),
AccountConstructs: onAccountConstructs,
AccountTeam: onAccountTeam,
AccountInstances: onAccountInstances,
diff --git a/server/src/rpc.rs b/server/src/rpc.rs
index ff61cd01..7ab789f1 100644
--- a/server/src/rpc.rs
+++ b/server/src/rpc.rs
@@ -44,7 +44,7 @@ use http::{AUTH_CLEAR, TOKEN_HEADER};
#[derive(Debug,Clone,Serialize)]
pub enum RpcMessage {
AccountState(Account),
- AccountAuthenticated(()),
+ AccountAuthenticated(Account),
AccountConstructs(Vec
),
AccountTeam(Vec),
AccountInstances(Vec),
diff --git a/server/src/user_anonymous.rs b/server/src/user_anonymous.rs
index 40359e58..872c478f 100644
--- a/server/src/user_anonymous.rs
+++ b/server/src/user_anonymous.rs
@@ -50,7 +50,6 @@ impl User for Anonymous {
self.send(RpcMessage::AccountState(self.account.clone()), events, ws)?;
self.send(RpcMessage::StartTutorial(()), events, ws)?;
- self.send(RpcMessage::ItemInfo(item_info()), events, ws)?;
Ok(())
}
@@ -75,6 +74,7 @@ impl User for Anonymous {
match v {
RpcRequest::Ping {} => return Ok(RpcMessage::Pong(())),
+ RpcRequest::ItemInfo {} => return Ok(RpcMessage::ItemInfo(item_info())),
RpcRequest::InstancePractice {} =>
Ok(RpcMessage::InstanceState(pg::instance_demo(&self.account)?)),
diff --git a/server/src/user_authenticated.rs b/server/src/user_authenticated.rs
index 252b516d..3cf25be8 100644
--- a/server/src/user_authenticated.rs
+++ b/server/src/user_authenticated.rs
@@ -71,7 +71,7 @@ impl User for Authorised {
info!("authenticated connection account={:?}", self.account);
let a = &self.account;
- ws.send(RpcMessage::AccountAuthenticated(()))?;
+ ws.send(RpcMessage::AccountAuthenticated(a.clone()))?;
// tell events we have connected
events.send(Event::Connect(self.id, a.clone(), ws.clone()))?;