Add localType to interfaces

This commit is contained in:
Nitwel
2020-10-24 12:47:11 +02:00
parent fc8bdffeee
commit d7f2ab11fd
8 changed files with 10 additions and 2 deletions

View File

@@ -67,6 +67,7 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp
if (inter.system === true) return false;
const matchesType = inter.types.includes(state.fieldData?.type || 'alias');
const matchesLocalType = inter.localTypes?.includes(type);
let matchesRelation = false;
if (type === 'standard' || type === 'presentation') {
@@ -81,7 +82,7 @@ function initLocalStore(collection: string, field: string, type: typeof localTyp
matchesRelation = inter.relationship === type;
}
return matchesType && matchesRelation;
return matchesType && matchesRelation && (matchesLocalType === undefined || matchesLocalType);
})
.sort((a, b) => (a.name > b.name ? 1 : -1));
});