From 44621ceedc123f3e10661654c3c46292bc52de86 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Mon, 12 Jul 2021 12:14:50 +1000 Subject: [PATCH] interface: skip deleted posts in NoteNavigation Fixes urbit/landscape#857 --- .../src/views/apps/publish/components/NoteNavigation.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/views/apps/publish/components/NoteNavigation.tsx b/pkg/interface/src/views/apps/publish/components/NoteNavigation.tsx index caf0c99ab..e2bd303ff 100644 --- a/pkg/interface/src/views/apps/publish/components/NoteNavigation.tsx +++ b/pkg/interface/src/views/apps/publish/components/NoteNavigation.tsx @@ -44,7 +44,11 @@ function getAdjacentId( ): BigInteger | null { const children = Array.from(graph); const i = children.findIndex(([index]) => index.eq(child)); - const target = children[backwards ? i + 1 : i - 1]; + let idx = backwards ? i + 1 : i - 1; + let target = children[idx]; + while(typeof target?.[1]?.post === 'string') { + target = children[backwards ? idx++ : idx--]; + } return target?.[0] || null; }