fix mutations
This commit is contained in:
parent
88a4ddd866
commit
59f39ee141
1 changed files with 3 additions and 2 deletions
|
@ -114,12 +114,13 @@ const Editor: Component<{ root: FileSystemDirectoryHandle }> = (props) => {
|
|||
switch (m.kind) {
|
||||
case MutarionKind.Update: {
|
||||
const entry = entries.get(index as any)!;
|
||||
return { kind: MutarionKind.Update, key: entry.key, lang, file: files.get(lang)! };
|
||||
return { kind: MutarionKind.Update, key: entry.key, lang, file: files.get(lang)!, value: m.value };
|
||||
}
|
||||
|
||||
case MutarionKind.Create: {
|
||||
if (typeof m.value === 'object') {
|
||||
return Object.entries(m.value).map(([lang, value]) => ({ kind: MutarionKind.Create, key: m.key, lang, file: files.get(lang)!, value }));
|
||||
const { key, ...locales } = m.value;
|
||||
return Object.entries(locales).map(([lang, value]) => ({ kind: MutarionKind.Create, key, lang, file: files.get(lang)!, value }));
|
||||
}
|
||||
|
||||
const entry = entries.get(index as any)!;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue