Don't show upgrade button for non AI streaming errors (#1680)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Show the upgrade button only for AI streaming errors by checking a shared error prefix; introduce and use a shared constant for consistent error messages. > > - **Chat UI** > - Update `ChatErrorBox.tsx` to display "Upgrade to Dyad Pro" only when `error` includes `AI_STREAMING_ERROR_MESSAGE_PREFIX` and user is not Pro (still hides on `TypeError: terminated`). > - **IPC/Streaming** > - In `chat_stream_handlers.ts`, prefix emitted streaming errors with `AI_STREAMING_ERROR_MESSAGE_PREFIX` instead of hardcoded text for consistency. > - **Shared** > - Add `AI_STREAMING_ERROR_MESSAGE_PREFIX` in `src/shared/texts.ts` and import where needed. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 83b1aa3555a3c1e710ee644f7bfb64cabc0ff5e6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This commit is contained in:
2
src/shared/texts.ts
Normal file
2
src/shared/texts.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export const AI_STREAMING_ERROR_MESSAGE_PREFIX =
|
||||
"Sorry, there was an error from the AI: ";
|
||||
Reference in New Issue
Block a user