mirror of
https://github.com/directus/directus.git
synced 2026-01-30 04:38:13 -05:00
fix translations for singleton (#11697)
This commit is contained in:
@@ -293,13 +293,16 @@ export default defineComponent({
|
||||
watch(
|
||||
() => props.value,
|
||||
(newVal, oldVal) => {
|
||||
if (newVal && !oldVal && !isEqual(newVal, oldVal) && isUndo.value === false) {
|
||||
loadItems();
|
||||
}
|
||||
|
||||
if (newVal === null || newVal.length === 0) {
|
||||
items.value = [];
|
||||
}
|
||||
|
||||
if (!newVal && oldVal) return; // when user clears whole translations value
|
||||
if (newVal && newVal.some((item) => typeof item === 'object') && oldVal) return; // when there's any new edits since edits are objects
|
||||
if (isEqual(newVal, oldVal)) return; // when user unfocus/blur inputs so they will be equal
|
||||
if (isUndo.value) return; // when user undo to the original value
|
||||
|
||||
loadItems();
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user