Skip to content

Commit

Permalink
Fix translations hint not linking to collection (directus#6172)
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten authored Jun 9, 2021
1 parent e20ad6c commit e9a8850
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,18 +370,20 @@ export default defineComponent({
const translationsCollection = computed(() => {
if (localType.value !== 'translations') return null;
const relation = relationsStore.relations.find((relation: Relation) => {
relation.related_collection === props.field.collection && relation.meta?.one_field === props.field.field;
const relation = relationsStore.relations.find((relation) => {
return (
relation.related_collection === props.field.collection && relation.meta?.one_field === props.field.field
);
});
if (!relation) return null;
return relation.collection;
});
const translationsFieldsCount = computed(() => {
const translationsFieldsCount = computed<number>(() => {
if (!translationsCollection.value) return 0;
const fields = fieldsStore.getFieldsForCollection(translationsCollection.value);
return fields.filter((field: Field) => field.meta?.hidden !== true).length;
});
Expand Down

0 comments on commit e9a8850

Please sign in to comment.