Skip to content

Commit

Permalink
chore(version): 0.8.24
Browse files Browse the repository at this point in the history
  • Loading branch information
kangfenmao committed Dec 11, 2024
1 parent 28a2744 commit a230ee2
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/assets/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/renderer/src/hooks/useUpdateHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/src/pages/home/Messages/Messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ const Messages: FC<Props> = ({ 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

Expand Down Expand Up @@ -158,6 +158,7 @@ const Messages: FC<Props> = ({ 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)
Expand Down
14 changes: 10 additions & 4 deletions src/renderer/src/pages/settings/AboutSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -133,7 +135,7 @@ const AboutSettings: FC = () => {
<Switch value={manualUpdateCheck} onChange={(v) => dispatch(setManualUpdateCheck(v))} />
</SettingRow>
</SettingGroup>
{update.info && (
{hasNewVersion && update.info && (
<SettingGroup theme={theme}>
<SettingRow>
<SettingRowTitle>
Expand Down Expand Up @@ -208,15 +210,19 @@ const AboutSettings: FC = () => {
<SettingRowTitle>
<TwitterOutlined />X
</SettingRowTitle>
<Button onClick={() => onOpenWebsite('https://x.com/kangfenmao')}>@kangfenmao</Button>
<Button onClick={() => onOpenWebsite('https://x.com/kangfenmao')}>
{t('settings.about.website.button')}
</Button>
</SettingRow>
<SettingDivider />
<SettingRow>
<SettingRowTitle>
<SendOutlined />
Telegram
</SettingRowTitle>
<Button onClick={() => onOpenWebsite('https://t.me/CherryStudioAI')}>@CherryStudioAI</Button>
<Button onClick={() => onOpenWebsite('https://t.me/CherryStudioAI')}>
{t('settings.about.website.button')}
</Button>
</SettingRow>
</SettingGroup>
</SettingContainer>
Expand Down
13 changes: 13 additions & 0 deletions src/renderer/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

0 comments on commit a230ee2

Please sign in to comment.