mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
Merge branch 'codex/fix/pending-escape-board-redirect'
# Conflicts: # src/components/post-form/post-form.tsx
This commit is contained in:
@@ -906,7 +906,7 @@ describe('PostForm', () => {
|
||||
await flushEffects();
|
||||
|
||||
expect(testState.resetPublishPostOptionsMock).toHaveBeenCalledTimes(1);
|
||||
expect(testState.navigateMock).toHaveBeenCalledWith('/pending/7');
|
||||
expect(testState.navigateMock).toHaveBeenCalledWith('/pending/7', { state: { boardPath: 'mu' } });
|
||||
});
|
||||
|
||||
it('redirects new posts to the board index when nonoko is used', async () => {
|
||||
|
||||
@@ -431,6 +431,7 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid:
|
||||
const subscriptions = account?.subscriptions || [];
|
||||
const directories = useDirectories();
|
||||
const directoryEntry = useDirectoryByAddress(effectiveBoardAddress);
|
||||
const pendingPostBoardPath = effectiveBoardAddress ? getBoardPath(effectiveBoardAddress, directories) : undefined;
|
||||
const rulesPath = effectiveBoardAddress ? `/rules/${getBoardPath(effectiveBoardAddress, directories)}` : '/rules';
|
||||
const showSpoilerForPost = directoryEntry?.features?.noSpoilers !== true;
|
||||
const showSpoilerForReply = directoryEntry?.features?.noSpoilerReplies !== true;
|
||||
@@ -556,10 +557,10 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid:
|
||||
if (nonokoRedirectPath) {
|
||||
navigate(nonokoRedirectPath, { state: getNonokoPendingRouteState(postIndex) });
|
||||
} else {
|
||||
navigate(`/pending/${postIndex}`);
|
||||
navigate(`/pending/${postIndex}`, pendingPostBoardPath ? { state: { boardPath: pendingPostBoardPath } } : undefined);
|
||||
}
|
||||
}
|
||||
}, [postIndex, resetPublishPostOptions, navigate]);
|
||||
}, [postIndex, pendingPostBoardPath, resetPublishPostOptions, navigate]);
|
||||
|
||||
// in post page, publish a reply to the post
|
||||
const isInPostView = isPostPageView(location.pathname, params);
|
||||
|
||||
Reference in New Issue
Block a user