mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(pending posts): clean up failed post display
This commit is contained in:
@@ -397,7 +397,8 @@ describe('CommentContent', () => {
|
||||
postCid: 'post-2',
|
||||
state: 'failed',
|
||||
});
|
||||
expect(container.textContent).toContain('Failed to publish');
|
||||
expect(container.textContent).not.toContain('Failed to publish');
|
||||
expect(container.textContent).toContain('still pending');
|
||||
expect(container.querySelector('[data-testid="loading-ellipsis"]')).toBeNull();
|
||||
|
||||
testState.stateString = 'Publishing';
|
||||
|
||||
@@ -131,6 +131,7 @@ const CommentContent = ({ comment: post, prependContent }: { comment: Comment; p
|
||||
const stateString = useStateString(resolvedPost);
|
||||
const hasFailedState = state === 'failed';
|
||||
const failedError = getFailedCommentError(resolvedPost);
|
||||
const shouldShowUnpublishedStateDetails = !cid && (!hasFailedState || Boolean(failedError));
|
||||
|
||||
const loadingString = (
|
||||
<div className={styles.stateString}>
|
||||
@@ -298,7 +299,7 @@ const CommentContent = ({ comment: post, prependContent }: { comment: Comment; p
|
||||
</Tooltip>
|
||||
</span>
|
||||
)}
|
||||
{!cid && (
|
||||
{shouldShowUnpublishedStateDetails && (
|
||||
<>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user