From 5dd74a101893043ae952da40304b71b835ad9b13 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Thu, 8 Aug 2024 23:53:18 +0800 Subject: [PATCH] chore(version): 0.5.2 --- package.json | 2 +- src/renderer/src/pages/home/components/Messages.tsx | 11 +++-------- src/renderer/src/store/settings.ts | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 708b45765..8b2ce7daf 100644 --- a/package.json +++ b/package.json @@ -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": "kangfenmao@qq.com", diff --git a/src/renderer/src/pages/home/components/Messages.tsx b/src/renderer/src/pages/home/components/Messages.tsx index c744140ac..108ea6a81 100644 --- a/src/renderer/src/pages/home/components/Messages.tsx +++ b/src/renderer/src/pages/home/components/Messages.tsx @@ -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' @@ -106,14 +106,9 @@ const Messages: FC = ({ 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)) diff --git a/src/renderer/src/store/settings.ts b/src/renderer/src/store/settings.ts index 26d9fb984..af7174d24 100644 --- a/src/renderer/src/store/settings.ts +++ b/src/renderer/src/store/settings.ts @@ -28,7 +28,7 @@ const initialState: SettingsState = { language: navigator.language, proxyUrl: undefined, userName: '', - showMessageDivider: true, + showMessageDivider: false, messageFont: 'system', showInputEstimatedTokens: false, theme: ThemeMode.light