Skip to content
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

fix:修复在服务器端未定义window时的错误处理 #10

Merged
merged 1 commit into from
Mar 8, 2025

Conversation

z5882852
Copy link
Contributor

@z5882852 z5882852 commented Mar 3, 2025

Summary

This pull request includes important changes to the web/app/components/base/chat/chat-with-history/index.tsx file to handle token checks more effectively and ensure proper redirection when the token is missing.

Improvements to token handling and redirection:

  • Added a new state variable hasToken to manage the token presence check.
  • Introduced a useEffect hook to ensure the code only runs in the browser environment and properly handles the token retrieval and redirection logic.
  • Updated the condition to render the component to include the hasToken state, ensuring the component does not render if the token is missing.

@FamousMai FamousMai merged commit 7970540 into YFGaia:main Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants