Skip to content

Commit

Permalink
Add sidebar tab switch on redirect (#1017)
Browse files Browse the repository at this point in the history
* 📝 docs: update documents

* 🐛 fix: Add sidebar tab switch on redirect

---------

Co-authored-by: 李篡 <licuan@ainnovation.com>
  • Loading branch information
lcxyhhxi and 李篡 authored Jan 12, 2024
1 parent 067f20e commit 88a1b7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/home/Redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { memo, useEffect } from 'react';

import { messageService } from '@/services/message';
import { sessionService } from '@/services/session';
import { useGlobalStore } from '@/store/global';
import { SidebarTabKey } from '@/store/global/initialState';
import { useSessionStore } from '@/store/session';

const checkHasConversation = async () => {
Expand All @@ -19,6 +21,8 @@ const Redirect = memo(() => {

useEffect(() => {
checkHasConversation().then((hasData) => {
useGlobalStore.getState().switchSideBar(SidebarTabKey.Chat);

if (hasData) {
router.push('/chat');

Expand Down

0 comments on commit 88a1b7b

Please sign in to comment.