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(typo): should be streamMessage #23

Merged
merged 1 commit into from
Apr 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/modules/Content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Content: FC<ContentProps> = ({ setActiveSetting }) => {
const conversation = conversations[currentId];
const messages = conversation?.messages ?? [];
const mode = conversation?.mode ?? 'text';
const stremMessage = streamMessageMap[currentId] ?? '';
const streamMessage = streamMessageMap[currentId] ?? '';
const loading = loadingMap[currentId];

useEffect(() => {
Expand All @@ -44,10 +44,10 @@ const Content: FC<ContentProps> = ({ setActiveSetting }) => {
// pre initialization
useEffect(() => {
if (hasMathJax()) return;
if (hasMath(stremMessage)) {
if (hasMath(streamMessage)) {
initMathJax();
}
}, [stremMessage]);
}, [streamMessage]);

const updateMessages = (msgs: Message[]) => {
setConversations((msg) => ({
Expand Down Expand Up @@ -172,12 +172,12 @@ const Content: FC<ContentProps> = ({ setActiveSetting }) => {

const stopGenerate = () => {
controller?.abort?.();
if (stremMessage) {
if (streamMessage) {
updateMessages(
messages.concat([
{
role: 'assistant',
content: stremMessage,
content: streamMessage,
createdAt: Date.now(),
},
])
Expand Down Expand Up @@ -267,7 +267,7 @@ const Content: FC<ContentProps> = ({ setActiveSetting }) => {
/>
<div className="flex-1 overflow-auto common-scrollbar p-5 pb-0">
<MessageBox
streamMessage={stremMessage}
streamMessage={streamMessage}
messages={messages}
mode={mode}
loading={loading}
Expand All @@ -276,7 +276,7 @@ const Content: FC<ContentProps> = ({ setActiveSetting }) => {
<MessageInput
text={text}
setText={setText}
streamMessage={stremMessage}
streamMessage={streamMessage}
showPrompt={showPrompt && mode !== 'image'}
setShowPrompt={setShowPrompt}
onSubmit={async (message: string) => {
Expand Down