fix: use taskMode getter and remove React hooks from switch statement

This commit is contained in:
Roo Code 2025-10-17 18:32:13 +00:00
parent 80fe47b532
commit eac9f8fee9
2 changed files with 7 additions and 2 deletions

View file

@ -108,7 +108,7 @@ export async function attemptCompletionTool(
}
// Send offer_pr message if not in PR Creator mode
if (cline.mode !== "pr-creator") {
if (cline.taskMode !== "pr-creator") {
await cline.say("offer_pr", "", undefined, false)
} else {
// In PR Creator mode, send PR Reviewer upsell after completion

View file

@ -131,7 +131,8 @@ export const ChatRowContent = ({
}: ChatRowContentProps) => {
const { t } = useTranslation()
const { mcpServers, alwaysAllowMcp, currentCheckpoint, mode, apiConfiguration, cloudApiUrl } = useExtensionState()
const { mcpServers, alwaysAllowMcp, currentCheckpoint, mode, apiConfiguration, cloudApiUrl, cloudIsAuthenticated } =
useExtensionState()
const { info: model } = useSelectedModel(apiConfiguration)
// Function to switch modes
@ -1278,6 +1279,10 @@ export const ChatRowContent = ({
</>
)
case "pr_reviewer_upsell":
// Only show if user is authenticated to Cloud
if (!cloudIsAuthenticated) {
return null
}
return (
<div className="ml-6 text-sm mt-2">
{t("chat:prReviewerUpsell.message")}{" "}