Skip to content

Commit

Permalink
♻️ refactor: separate message slice and aiChat slice (#4359)
Browse files Browse the repository at this point in the history
* ♻️ refactor: separate message slice and ai-chat slice

* 🎨 chore: clean code

* ♻️ refactor: refactor the initialState

* ♻️ refactor: refactor the initialState

* ✅ test: add more tests
  • Loading branch information
arvinxx authored Oct 13, 2024
1 parent 99308de commit 7d037f6
Show file tree
Hide file tree
Showing 17 changed files with 1,580 additions and 1,435 deletions.
2 changes: 1 addition & 1 deletion src/features/ChatInput/useSend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react';

import { useChatStore } from '@/store/chat';
import { chatSelectors } from '@/store/chat/selectors';
import { SendMessageParams } from '@/store/chat/slices/message/action';
import { SendMessageParams } from '@/store/chat/slices/aiChat/action';
import { fileChatSelectors, useFileStore } from '@/store/file';

export type UseSendMessageParams = Pick<
Expand Down
3 changes: 3 additions & 0 deletions src/store/chat/initialState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import { ChatPortalState, initialChatPortalState } from './slices/portal/initial
import { ChatMessageState, initialMessageState } from './slices/message/initialState';
import { ChatShareState, initialShareState } from './slices/share/initialState';
import { ChatTopicState, initialTopicState } from './slices/topic/initialState';
import { ChatAIChatState, initialAiChatState } from './slices/aiChat/initialState';

export type ChatStoreState = ChatTopicState &
ChatMessageState &
ChatAIChatState &
ChatToolState &
ChatShareState &
ChatPortalState;

export const initialState: ChatStoreState = {
...initialMessageState,
...initialAiChatState,
...initialTopicState,
...initialToolState,
...initialShareState,
Expand Down
Loading

0 comments on commit 7d037f6

Please sign in to comment.