Fix selecting existing item creating empty duplicate row

Fixes #514
This commit is contained in:
rijkvanzanten
2020-10-05 18:19:30 -04:00
parent 60d038deff
commit 57ec6eab7e

View File

@@ -161,7 +161,9 @@ export default function usePreview({
const junctionPrimaryKey = junctionCollectionPrimaryKeyField.value.field;
return (value.value || []).filter((stagedEdit: any) => !stagedEdit.$delete && !stagedEdit[junctionPrimaryKey]);
return (value.value || []).filter(
(stagedEdit: any) => !stagedEdit.$delete && !stagedEdit[junctionPrimaryKey] && stagedEdit.$new === true
);
}
/**