feat: added setshowassistants function to useshowassistants hook and updated error handling logic

This commit is contained in:
kangfenmao 2024-12-13 16:37:48 +08:00
parent 6af07c278d
commit 7d561dbfb7
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,5 @@
import { useAppDispatch, useAppSelector } from '@renderer/store' import { useAppDispatch, useAppSelector } from '@renderer/store'
import { setShowTopics, toggleShowAssistants, toggleShowTopics } from '@renderer/store/settings' import { setShowAssistants, setShowTopics, toggleShowAssistants, toggleShowTopics } from '@renderer/store/settings'
export function useShowAssistants() { export function useShowAssistants() {
const showAssistants = useAppSelector((state) => state.settings.showAssistants) const showAssistants = useAppSelector((state) => state.settings.showAssistants)
@ -7,6 +7,7 @@ export function useShowAssistants() {
return { return {
showAssistants, showAssistants,
setShowAssistants: (show: boolean) => dispatch(setShowAssistants(show)),
toggleShowAssistants: () => dispatch(toggleShowAssistants()) toggleShowAssistants: () => dispatch(toggleShowAssistants())
} }
} }

View File

@ -54,11 +54,13 @@ export default function useUpdateHandler() {
downloadProgress: 0 downloadProgress: 0
}) })
) )
window.modal.info({ if (window.location.hash.includes('settings/about')) {
title: t('settings.about.updateError'), window.modal.info({
content: error?.message || t('settings.about.updateError'), title: t('settings.about.updateError'),
icon: null content: error?.message || t('settings.about.updateError'),
}) icon: null
})
}
}) })
] ]
return () => removers.forEach((remover) => remover()) return () => removers.forEach((remover) => remover())