improved textField component and allowed 8 caracter names
This commit is contained in:
parent
49a0125f88
commit
67a9bd2520
10 changed files with 36 additions and 35 deletions
|
@ -1,5 +1,6 @@
|
|||
import {LocalUser} from "./LocalUser";
|
||||
|
||||
//todo: add localstorage fallback
|
||||
class LocalUserStore {
|
||||
|
||||
saveUser(localUser: LocalUser) {
|
||||
|
@ -10,6 +11,14 @@ class LocalUserStore {
|
|||
const data = localStorage.getItem('localUser');
|
||||
return data ? JSON.parse(data) : null;
|
||||
}
|
||||
|
||||
setName(name:string): void {
|
||||
window.localStorage.setItem('playerName', name);
|
||||
}
|
||||
|
||||
getName(): string {
|
||||
return window.localStorage.getItem('playerName') ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue