Skip to content

Commit

Permalink
feat: added setshowassistants function to useshowassistants hook and …
Browse files Browse the repository at this point in the history
…updated error handling logic
  • Loading branch information
kangfenmao committed Dec 13, 2024
1 parent 6af07c2 commit 7d561db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/renderer/src/hooks/useStore.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
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() {
const showAssistants = useAppSelector((state) => state.settings.showAssistants)
const dispatch = useAppDispatch()

return {
showAssistants,
setShowAssistants: (show: boolean) => dispatch(setShowAssistants(show)),
toggleShowAssistants: () => dispatch(toggleShowAssistants())
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/renderer/src/hooks/useUpdateHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ export default function useUpdateHandler() {
downloadProgress: 0
})
)
window.modal.info({
title: t('settings.about.updateError'),
content: error?.message || t('settings.about.updateError'),
icon: null
})
if (window.location.hash.includes('settings/about')) {
window.modal.info({
title: t('settings.about.updateError'),
content: error?.message || t('settings.about.updateError'),
icon: null
})
}
})
]
return () => removers.forEach((remover) => remover())
Expand Down

0 comments on commit 7d561db

Please sign in to comment.