mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-03-28 11:13:16 +00:00
fix: edit page crashing
This commit is contained in:
parent
a6b444fcea
commit
c78f54824e
2 changed files with 2 additions and 4 deletions
|
|
@ -64,8 +64,6 @@ export default function EditForm({ mii, likes }: Props) {
|
|||
if (name != mii.name) formData.append("name", name);
|
||||
if (tags != mii.tags) formData.append("tags", JSON.stringify(tags));
|
||||
if (description && description != mii.description) formData.append("description", description);
|
||||
console.log(minifyInstructions(structuredClone(instructions.current)));
|
||||
console.log(mii.instructions);
|
||||
if (minifyInstructions(structuredClone(instructions.current)) !== (mii.instructions as object))
|
||||
formData.append("instructions", JSON.stringify(instructions.current));
|
||||
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ export default function EyesTab({ instructions }: Props) {
|
|||
const [tab, setTab] = useState(0);
|
||||
const [colors, setColors] = useState<number[]>(() =>
|
||||
TABS.map((t) => {
|
||||
const entry = instructions.current.eyes[t.name];
|
||||
const color = "color" in entry ? entry.color : null;
|
||||
const entry = instructions.current.eyes[t.name] ?? {};
|
||||
const color = entry && "color" in entry ? entry.color : null;
|
||||
return color ?? 122;
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue