diff --git a/src/app.tsx b/src/app.tsx
index ffba5fae..ce795174 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -1,7 +1,10 @@
import { useEffect, useState } from 'react';
import { Outlet, Route, Routes, useLocation, useParams } from 'react-router-dom';
+import { useAccountComment } from '@plebbit/plebbit-react-hooks';
import { isAllView, isSubscriptionsView } from './lib/utils/view-utils';
import useIsMobile from './hooks/use-is-mobile';
+import useTheme from './hooks/use-theme';
+import { timeFilterNames } from './hooks/use-time-filter';
import styles from './app.module.css';
import Board from './views/board';
import Catalog from './views/catalog';
@@ -16,8 +19,6 @@ import ChallengeModal from './components/challenge-modal';
import PostForm from './components/post-form';
import SubplebbitStats from './components/subplebbit-stats';
import TopBar from './components/topbar';
-import { timeFilterNames } from './hooks/use-time-filter';
-import useTheme from './hooks/use-theme';
const BoardLayout = () => {
const { accountCommentIndex, subplebbitAddress, timeFilterName } = useParams();
@@ -25,8 +26,9 @@ const BoardLayout = () => {
const isMobile = useIsMobile();
const isInAllView = isAllView(location.pathname, useParams());
const isInSubscriptionsView = isSubscriptionsView(location.pathname, useParams());
+ const pendingPost = useAccountComment({ commentIndex: accountCommentIndex ? parseInt(accountCommentIndex) : undefined });
- const isValidAccountCommentIndex = !accountCommentIndex || (!isNaN(parseInt(accountCommentIndex)) && parseInt(accountCommentIndex) >= 0);
+ const isValidAccountCommentIndex = !accountCommentIndex || (!isNaN(Number(accountCommentIndex)) && Number(accountCommentIndex) >= 0);
if (!isValidAccountCommentIndex || (timeFilterName && !timeFilterNames.includes(timeFilterName))) {
return ;
@@ -42,13 +44,13 @@ const BoardLayout = () => {
{isMobile
- ? (subplebbitAddress || isInAllView || isInSubscriptionsView) && (
+ ? (subplebbitAddress || isInAllView || isInSubscriptionsView || pendingPost?.subplebbitAddress) && (
<>
>
)
- : (subplebbitAddress || isInAllView || isInSubscriptionsView) && (
+ : (subplebbitAddress || isInAllView || isInSubscriptionsView || pendingPost?.subplebbitAddress) && (
<>
{!(isInAllView || isInSubscriptionsView) && }
diff --git a/src/components/board-buttons/board-buttons.tsx b/src/components/board-buttons/board-buttons.tsx
index e6a319be..064672eb 100644
--- a/src/components/board-buttons/board-buttons.tsx
+++ b/src/components/board-buttons/board-buttons.tsx
@@ -267,11 +267,9 @@ export const DesktopBoardButtons = () => {
] [
]
- {isInPostView && (
-
-
-
- )}
+
+
+
>
) : (
<>
diff --git a/src/views/pending-post/pending-post.tsx b/src/views/pending-post/pending-post.tsx
index fae00bdf..72980b28 100644
--- a/src/views/pending-post/pending-post.tsx
+++ b/src/views/pending-post/pending-post.tsx
@@ -28,7 +28,7 @@ const PendingPost = () => {
return (
<>
{isInSettingsView && }
-
+
>
);
};