fix(state): changing species clears language, citizenship, and subspecies selections

This commit is contained in:
lew 2026-03-24 02:33:35 +00:00
parent 48f8b46827
commit c220815b89
20 changed files with 172 additions and 104 deletions

View file

@ -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;