diff --git a/package.json b/package.json index cba4dfecd..82cace0a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CherryStudio", - "version": "0.8.23", + "version": "0.8.24", "private": true, "description": "A powerful AI assistant for producer.", "main": "./out/main/index.js", diff --git a/src/renderer/src/assets/styles/index.scss b/src/renderer/src/assets/styles/index.scss index 42cd1f959..49c923248 100644 --- a/src/renderer/src/assets/styles/index.scss +++ b/src/renderer/src/assets/styles/index.scss @@ -173,7 +173,7 @@ body[os='mac'] { #content-container { border-top-left-radius: 12px; border-left: 0.5px solid var(--color-border); - box-shadow: -2px 0px 24px -4px rgba(0, 0, 0, 0.1); + box-shadow: -2px 0px 20px -4px rgba(0, 0, 0, 0.08); } } diff --git a/src/renderer/src/hooks/useUpdateHandler.ts b/src/renderer/src/hooks/useUpdateHandler.ts index 910e8362e..838f17c40 100644 --- a/src/renderer/src/hooks/useUpdateHandler.ts +++ b/src/renderer/src/hooks/useUpdateHandler.ts @@ -13,7 +13,9 @@ export default function useUpdateHandler() { const removers = [ ipcRenderer.on('update-not-available', () => { dispatch(setUpdateState({ checking: false })) - window.message.success(t('settings.about.updateNotAvailable')) + if (window.location.hash.includes('settings/about')) { + window.message.success(t('settings.about.updateNotAvailable')) + } }), ipcRenderer.on('update-available', (_, releaseInfo: UpdateInfo) => { dispatch( diff --git a/src/renderer/src/pages/home/Messages/Messages.tsx b/src/renderer/src/pages/home/Messages/Messages.tsx index 6ec165924..8e2d9ee6a 100644 --- a/src/renderer/src/pages/home/Messages/Messages.tsx +++ b/src/renderer/src/pages/home/Messages/Messages.tsx @@ -77,8 +77,8 @@ const Messages: FC = ({ assistant, topic, setActiveTopic }) => { const { updateTopic, addTopic } = useAssistant(assistant.id) const { showTopics, topicPosition, showAssistants, enableTopicNaming } = useSettings() - const INITIAL_MESSAGES_COUNT = 15 - const LOAD_MORE_COUNT = 15 + const INITIAL_MESSAGES_COUNT = 20 + const LOAD_MORE_COUNT = 20 messagesRef.current = messages @@ -158,6 +158,7 @@ const Messages: FC = ({ assistant, topic, setActiveTopic }) => { EventEmitter.on(EVENT_NAMES.AI_AUTO_RENAME, autoRenameTopic), EventEmitter.on(EVENT_NAMES.CLEAR_MESSAGES, () => { setMessages([]) + setDisplayMessages([]) const defaultTopic = getDefaultTopic(assistant.id) updateTopic({ ...topic, name: defaultTopic.name, messages: [] }) TopicManager.clearTopicMessages(topic.id) diff --git a/src/renderer/src/pages/settings/AboutSettings.tsx b/src/renderer/src/pages/settings/AboutSettings.tsx index e16fc1652..65751e5c7 100644 --- a/src/renderer/src/pages/settings/AboutSettings.tsx +++ b/src/renderer/src/pages/settings/AboutSettings.tsx @@ -10,7 +10,7 @@ import { useSettings } from '@renderer/hooks/useSettings' import { useAppDispatch } from '@renderer/store' import { setUpdateState } from '@renderer/store/runtime' import { setManualUpdateCheck } from '@renderer/store/settings' -import { runAsyncFunction } from '@renderer/utils' +import { compareVersions, runAsyncFunction } from '@renderer/utils' import { Avatar, Button, Progress, Row, Switch, Tag } from 'antd' import { debounce } from 'lodash' import { FC, useEffect, useState } from 'react' @@ -71,6 +71,8 @@ const AboutSettings: FC = () => { }) } + const hasNewVersion = update?.info?.version && version ? compareVersions(update.info.version, version) > 0 : false + useEffect(() => { runAsyncFunction(async () => { const appInfo = await window.api.getAppInfo() @@ -133,7 +135,7 @@ const AboutSettings: FC = () => { dispatch(setManualUpdateCheck(v))} /> - {update.info && ( + {hasNewVersion && update.info && ( @@ -208,7 +210,9 @@ const AboutSettings: FC = () => { X - + @@ -216,7 +220,9 @@ const AboutSettings: FC = () => { Telegram - + diff --git a/src/renderer/src/utils/index.ts b/src/renderer/src/utils/index.ts index 54a7d7d96..7f7a49418 100644 --- a/src/renderer/src/utils/index.ts +++ b/src/renderer/src/utils/index.ts @@ -363,4 +363,17 @@ export function sortByEnglishFirst(a: string, b: string) { return a.localeCompare(b) } +export const compareVersions = (v1: string, v2: string): number => { + const v1Parts = v1.split('.').map(Number) + const v2Parts = v2.split('.').map(Number) + + for (let i = 0; i < Math.max(v1Parts.length, v2Parts.length); i++) { + const v1Part = v1Parts[i] || 0 + const v2Part = v2Parts[i] || 0 + if (v1Part > v2Part) return 1 + if (v1Part < v2Part) return -1 + } + return 0 +} + export { classNames }