core: fix project icon update to preserve existing icon properties
This commit is contained in:
parent
2ad99713f3
commit
7439a40b00
1 changed files with 3 additions and 3 deletions
|
|
@ -22,8 +22,8 @@ export namespace Project {
|
||||||
name: z.string().optional(),
|
name: z.string().optional(),
|
||||||
icon: z
|
icon: z
|
||||||
.object({
|
.object({
|
||||||
url: z.string(),
|
url: z.string().optional(),
|
||||||
color: z.string(),
|
color: z.string().optional(),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
time: z.object({
|
time: z.object({
|
||||||
|
|
@ -135,8 +135,8 @@ export namespace Project {
|
||||||
const url = `data:${mime};base64,${base64}`
|
const url = `data:${mime};base64,${base64}`
|
||||||
await Storage.update<Info>(["project", input.id], (draft) => {
|
await Storage.update<Info>(["project", input.id], (draft) => {
|
||||||
draft.icon = {
|
draft.icon = {
|
||||||
|
...draft.icon,
|
||||||
url,
|
url,
|
||||||
color: draft.icon?.color ?? "#000000",
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue