authenticated msgs
This commit is contained in:
@@ -100,25 +100,23 @@ function Play(args) {
|
||||
|
||||
const list = () => {
|
||||
return (
|
||||
<div>
|
||||
<div class='list play'>
|
||||
<figure>
|
||||
<button
|
||||
class="ready"
|
||||
onClick={() => sendInstancePractice()}>
|
||||
Tutorial
|
||||
</button>
|
||||
<figcaption>Learn MNML</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<button
|
||||
class='discord-btn'
|
||||
onClick={() => window.open('https://discord.gg/YJJgurM') }>
|
||||
|
||||
</button>
|
||||
<figcaption>Join the Community</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
<div class='list play'>
|
||||
<figure>
|
||||
<button
|
||||
class="ready"
|
||||
onClick={() => sendInstancePractice()}>
|
||||
Tutorial
|
||||
</button>
|
||||
<figcaption>Learn MNML</figcaption>
|
||||
</figure>
|
||||
<figure>
|
||||
<button
|
||||
class='discord-btn'
|
||||
onClick={() => window.open('https://discord.gg/YJJgurM') }>
|
||||
|
||||
</button>
|
||||
<figcaption>Join the Community</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -127,8 +125,9 @@ function Play(args) {
|
||||
<section class="top">
|
||||
<div class="news">
|
||||
<h1>Welcome to MNML</h1>
|
||||
{news}
|
||||
{list()}
|
||||
<hr />
|
||||
{news}
|
||||
</div>
|
||||
<Welcome />
|
||||
</section>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user