mirror of
https://github.com/wassname/talk.git
synced 2026-08-17 11:27:52 +08:00
Filter null comments coming into moderation queues to prevent white screening (#2509)
Wyatt and I are not sure why comments are coming back null, but this should keep the moderation area from blanking out when it errors handling nulled out comments crashing the queue. FIXME tag added with Wyatt/Nick as this is only a patching fix and does not resolve the underlying issue.
This commit is contained in:
@@ -71,26 +71,29 @@ const Queue: FunctionComponent<Props> = ({
|
||||
</Flex>
|
||||
)}
|
||||
<TransitionGroup component={null} appear={false} enter={false} exit>
|
||||
{comments.map(c => (
|
||||
<CSSTransition
|
||||
key={c.id}
|
||||
timeout={400}
|
||||
classNames={{
|
||||
exit: styles.exitTransition,
|
||||
exitActive: styles.exitTransitionActive,
|
||||
exitDone: styles.exitTransitionDone,
|
||||
}}
|
||||
>
|
||||
<ModerateCardContainer
|
||||
settings={settings}
|
||||
viewer={viewer}
|
||||
comment={c}
|
||||
danglingLogic={danglingLogic}
|
||||
showStoryInfo={Boolean(allStories)}
|
||||
onUsernameClicked={onShowUserDrawer}
|
||||
/>
|
||||
</CSSTransition>
|
||||
))}
|
||||
{comments
|
||||
// FIXME (Nick/Wyatt): Investigate why comments are coming back null
|
||||
.filter(c => Boolean(c))
|
||||
.map(c => (
|
||||
<CSSTransition
|
||||
key={c.id}
|
||||
timeout={400}
|
||||
classNames={{
|
||||
exit: styles.exitTransition,
|
||||
exitActive: styles.exitTransitionActive,
|
||||
exitDone: styles.exitTransitionDone,
|
||||
}}
|
||||
>
|
||||
<ModerateCardContainer
|
||||
settings={settings}
|
||||
viewer={viewer}
|
||||
comment={c}
|
||||
danglingLogic={danglingLogic}
|
||||
showStoryInfo={Boolean(allStories)}
|
||||
onUsernameClicked={onShowUserDrawer}
|
||||
/>
|
||||
</CSSTransition>
|
||||
))}
|
||||
</TransitionGroup>
|
||||
{hasMore && (
|
||||
<Flex justifyContent="center">
|
||||
|
||||
Reference in New Issue
Block a user