do client check for tutorial instead of server side
This commit is contained in:
parent
8f6c8c304a
commit
b6267cf2a0
@ -107,6 +107,7 @@ function registerEvents(store) {
|
||||
}
|
||||
|
||||
function setAuthenticated(account) {
|
||||
|
||||
if (account && window.Notification) {
|
||||
window.Notification.requestPermission();
|
||||
}
|
||||
@ -115,6 +116,9 @@ function registerEvents(store) {
|
||||
LogRocket.identify(account.id, account);
|
||||
}
|
||||
|
||||
const { tutorial, ws } = store.getState();
|
||||
if (tutorial) ws.sendInstancePractice();
|
||||
|
||||
store.dispatch(actions.setAccount(account));
|
||||
store.dispatch(actions.setAuthenticated(true));
|
||||
}
|
||||
|
||||
@ -530,7 +530,7 @@ pub fn img_check(account: &Account) -> Result<Uuid, Error> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tutorial(tx: &mut Transaction, account: &Account) -> Result<Option<Instance>, Error> {
|
||||
pub fn _tutorial(tx: &mut Transaction, account: &Account) -> Result<Option<Instance>, Error> {
|
||||
let query = "
|
||||
SELECT count(id)
|
||||
FROM players
|
||||
|
||||
@ -128,9 +128,9 @@ impl User for Authenticated {
|
||||
let wheel = account::chat_wheel(&db, a.id)?;
|
||||
self.ws.send(RpcMessage::ChatWheel(wheel))?;
|
||||
|
||||
if let Some(instance) = account::tutorial(&mut tx, &a)? {
|
||||
self.ws.send(RpcMessage::InstanceState(instance))?;
|
||||
}
|
||||
// if let Some(instance) = account::tutorial(&mut tx, &a)? {
|
||||
// self.ws.send(RpcMessage::InstanceState(instance))?;
|
||||
// }
|
||||
|
||||
// tx should do nothing
|
||||
tx.commit()?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user