don't start tutorial after registration

This commit is contained in:
ntr 2020-01-14 09:26:52 +10:00
parent caa5d31012
commit bc0d00fd2b
2 changed files with 0 additions and 25 deletions

View File

@ -530,24 +530,3 @@ pub fn img_check(account: &Account) -> Result<Uuid, Error> {
}
}
pub fn tutorial(tx: &mut Transaction, account: &Account) -> Result<Option<Instance>, Error> {
let query = "
SELECT count(id)
FROM players
WHERE account = $1;
";
let result = tx
.query(query, &[&account.id])?;
let row = result.iter().next()
.ok_or(format_err!("unable to fetch joined games account={:?}", account))?;
let count: i64 = row.get(0);
if count == 0 {
return Ok(Some(instance_practice(tx, account)?));
}
return Ok(None);
}

View File

@ -128,10 +128,6 @@ 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))?;
}
// tx should do nothing
tx.commit()?;