From a584da56c5b7505e8e0c07e2124d6bd585e7619b Mon Sep 17 00:00:00 2001 From: Ross Keenan Date: Fri, 21 Jan 2022 07:19:13 +0200 Subject: [PATCH] fix(impliedRelations): :bug: A fallback field already is the opp field --- src/graphUtils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/graphUtils.ts b/src/graphUtils.ts index eeb1cc16..6b2ee71e 100644 --- a/src/graphUtils.ts +++ b/src/graphUtils.ts @@ -178,6 +178,8 @@ export function getFieldInfo(userHiers: UserHier[], field: string) { } export function getOppFields(userHiers: UserHier[], field: string) { + // If the field ends with `>`, it is already the opposite field we need (coming from getOppFallback`) + if (field.endsWith(">")) return field.slice(0, -4); const { fieldHier, fieldDir } = getFieldInfo(userHiers, field); const oppDir = getOppDir(fieldDir); return fieldHier[oppDir];