fix: support both legacy and current currentItemRoundness formats

Add union type to accept both the old object format {type, value} and
the new enum format for backwards compatibility with existing drawings.
This commit is contained in:
Zimeng Xiong
2026-01-20 09:37:14 -08:00
parent a8615d9087
commit bea26a3abd
+10 -1
View File
@@ -319,7 +319,16 @@ export const appStateSchema = z
.enum(["solid", "dashed", "dotted"]) .enum(["solid", "dashed", "dotted"])
.optional() .optional()
.nullable(), .nullable(),
currentItemRoundness: z.enum(["sharp", "round"]).optional().nullable(), currentItemRoundness: z
.union([
z.enum(["sharp", "round"]),
z.object({
type: z.enum(["round", "sharp"]),
value: z.number().finite().min(0).max(1),
}),
])
.optional()
.nullable(),
currentItemFontSize: z currentItemFontSize: z
.number() .number()
.finite() .finite()