mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 17:53:29 +00:00
bug: anon names (#795)
## Description: Fix a bad conflict resolution from enabling `strictNullChecks`. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
co-authored by
Scott Anderson
parent
95e0e9fa33
commit
1ebf6d4fab
@@ -112,7 +112,7 @@ export class UnitView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class PlayerView {
|
export class PlayerView {
|
||||||
public anonymousName: string;
|
public anonymousName: string | null = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private game: GameView,
|
private game: GameView,
|
||||||
@@ -122,8 +122,10 @@ export class PlayerView {
|
|||||||
if (data.clientID === game.myClientID()) {
|
if (data.clientID === game.myClientID()) {
|
||||||
this.anonymousName = this.data.name;
|
this.anonymousName = this.data.name;
|
||||||
} else {
|
} else {
|
||||||
this.anonymousName =
|
this.anonymousName = createRandomName(
|
||||||
createRandomName(this.data.name, this.data.playerType) ?? "";
|
this.data.name,
|
||||||
|
this.data.playerType,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user