fix(state): changing species clears language, citizenship, and subspecies selections
This commit is contained in:
parent
48f8b46827
commit
c220815b89
20 changed files with 172 additions and 104 deletions
|
|
@ -1,13 +1,11 @@
|
|||
import type { Character } from '../types';
|
||||
|
||||
const DEFAULT_LANGUAGES = ['Tau Ceti Basic'];
|
||||
|
||||
export function isBlankCharacter(char: Character): boolean {
|
||||
if (!char.data) return true;
|
||||
for (const value of Object.values(char.data)) {
|
||||
if (value === '' || value === undefined || value === null || value === 0) continue;
|
||||
if (Array.isArray(value)) {
|
||||
if (value.length === 0) continue;
|
||||
if (value.length === 1 && DEFAULT_LANGUAGES.includes(value[0])) continue;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue