Skip to content

Commit

Permalink
chore(version): 0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Aug 8, 2024
1 parent e028d06 commit 5dd74a1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cherry-studio",
"version": "0.5.1",
"version": "0.5.2",
"description": "A powerful AI assistant for producer.",
"main": "./out/main/index.js",
"author": "[email protected]",
Expand Down
11 changes: 3 additions & 8 deletions src/renderer/src/pages/home/components/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Assistant, Message, Model, Topic } from '@renderer/types'
import { getBriefInfo, runAsyncFunction, uuid } from '@renderer/utils'
import { t } from 'i18next'
import localforage from 'localforage'
import { debounce, last, reverse } from 'lodash'
import { last, reverse } from 'lodash'
import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import styled from 'styled-components'

Expand Down Expand Up @@ -106,14 +106,9 @@ const Messages: FC<Props> = ({ assistant, topic }) => {
})
}, [topic.id])

const scrollTop = useCallback(
debounce(() => containerRef.current?.scrollTo({ top: 100000, behavior: 'auto' }), 500),
[]
)

useEffect(() => {
scrollTop()
}, [messages, lastMessage, scrollTop])
setTimeout(() => containerRef.current?.scrollTo({ top: containerRef.current.scrollHeight, behavior: 'auto' }), 0)
}, [messages])

useEffect(() => {
EventEmitter.emit(EVENT_NAMES.ESTIMATED_TOKEN_COUNT, estimateHistoryTokenCount(assistant, messages))
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const initialState: SettingsState = {
language: navigator.language,
proxyUrl: undefined,
userName: '',
showMessageDivider: true,
showMessageDivider: false,
messageFont: 'system',
showInputEstimatedTokens: false,
theme: ThemeMode.light
Expand Down

0 comments on commit 5dd74a1

Please sign in to comment.