-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
🐛 Fixed if all comments are hidden, no comments are visible #22912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
closes TryGhost#22331 load the auth frame even if there are no visible comments because we can't check for hidden comments without having the auth frame loaded
WalkthroughThe changes update the conditional logic for rendering the Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/comments-ui/src/App.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-i18next". (The package "eslint-plugin-i18next" was not found when loaded as a Node module from the directory "/apps/comments-ui".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-i18next" was referenced from the config file in "apps/comments-ui/.eslintrc.js". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
apps/comments-ui/src/App.tsx
Outdated
@@ -224,7 +224,7 @@ const App: React.FC<AppProps> = ({scriptTag}) => { | |||
<CommentsFrame ref={iframeRef}> | |||
<ContentBox done={done} /> | |||
</CommentsFrame> | |||
{state.comments.length > 0 ? <AuthFrame adminUrl={options.adminUrl} onLoad={initAdminAuth}/> : null} | |||
{state.initStatus === 'success' && <AuthFrame adminUrl={options.adminUrl} onLoad={initAdminAuth}/>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I first tried always rendering <AuthFrame
but that lead to a stuck loading state. Perhaps a more involved change is required to avoid this conditional render entirely.
apps/comments-ui/src/App.tsx
Outdated
@@ -224,7 +224,7 @@ const App: React.FC<AppProps> = ({scriptTag}) => { | |||
<CommentsFrame ref={iframeRef}> | |||
<ContentBox done={done} /> | |||
</CommentsFrame> | |||
{state.comments.length > 0 ? <AuthFrame adminUrl={options.adminUrl} onLoad={initAdminAuth}/> : null} | |||
{state.initStatus === 'success' && <AuthFrame adminUrl={options.adminUrl} onLoad={initAdminAuth}/>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you could reuse the done
constant to avoid logic duplication, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks for the suggestion, I've made that change
closes #22331
load the auth frame even if there are no visible comments because we can't check for hidden comments without having the auth frame loaded
The fix is based on the suggestion in #22331 (comment)
Change covered with automated tests and confirmed manually in dev environment.