diff --git a/src/components/board-header/board-header.tsx b/src/components/board-header/board-header.tsx index d2abb9e6..bc955781 100644 --- a/src/components/board-header/board-header.tsx +++ b/src/components/board-header/board-header.tsx @@ -63,7 +63,7 @@ const BoardHeader = () => { ? shortAddress.endsWith('.eth') || shortAddress.endsWith('.sol') ? shortAddress.slice(0, -4) : shortAddress - : Plebbit.getShortAddress(subplebbitAddress))} + : subplebbitAddress && Plebbit.getShortAddress(subplebbitAddress))} {(isOffline || isOnlineStatusLoading) && !isInAllView && !isInSubscriptionsView && !isInModView && ( diff --git a/src/views/pending-post/pending-post.tsx b/src/views/pending-post/pending-post.tsx index 7c285b98..6e12f491 100644 --- a/src/views/pending-post/pending-post.tsx +++ b/src/views/pending-post/pending-post.tsx @@ -14,13 +14,10 @@ const PendingPost = () => { const isValidAccountCommentIndex = !accountCommentIndex || - // Check if it's a valid positive integer (!isNaN(parseInt(accountCommentIndex)) && parseInt(accountCommentIndex) >= 0 && Number.isInteger(parseFloat(accountCommentIndex)) && - // Allow index to be at most 1 position beyond the current length - // This handles the case where a new post is being created - (accountComments?.length === 0 || parseInt(accountCommentIndex) <= accountComments.length)); + (accountComments?.length === 0 || parseInt(accountCommentIndex) < accountComments.length)); useEffect(() => { if (!isValidAccountCommentIndex) {