This commit is contained in:
2026-02-15 21:21:56 -05:00
parent 8be13e14bc
commit d6c98bcf10
10 changed files with 139 additions and 84 deletions

View File

@@ -1,4 +1,4 @@
use openworm::net::CreateAccount;
use openworm::net::{CreateAccount, CreateAccountResp};
use crate::net::{self, ConnectInfo};
@@ -81,6 +81,15 @@ pub fn create_account(rsc: &mut Rsc) -> WeakWidget {
else {
return fail("failed to create account");
};
let id = match resp {
CreateAccountResp::Ok { id } => id,
CreateAccountResp::UsernameExists => {
return fail("username already exists");
}
CreateAccountResp::InvalidToken => {
return fail("invalid account token");
}
};
println!("account created!!!!");
});
});