From f4d92340242ec4eec6bfb59aa2469d6bd1f255a8 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Wed, 7 Apr 2021 17:43:53 +0200 Subject: [PATCH] fix loading wrong relations (#4876) --- app/src/stores/relations.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/stores/relations.ts b/app/src/stores/relations.ts index f3c0da0f2f..b4bdb0e655 100644 --- a/app/src/stores/relations.ts +++ b/app/src/stores/relations.ts @@ -52,7 +52,10 @@ export const useRelationsStore = createStore({ } const relations: Relation[] = this.getRelationsForCollection(collection).filter((relation: Relation) => { - return relation.many_field === field || relation.one_field === field; + return ( + (relation.many_collection === collection && relation.many_field === field) || + (relation.one_collection === collection && relation.one_field === field) + ); }); if (relations.length > 0) {