Skip to content

Commit

Permalink
fix: user can't view model setting in local api server
Browse files Browse the repository at this point in the history
Signed-off-by: James <[email protected]>
  • Loading branch information
James committed Jan 26, 2024
1 parent f9e9185 commit 7df2888
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions web/hooks/usePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 11,14 @@ export const usePath = () => {
const selectedModel = useAtomValue(selectedModelAtom)

const onReviewInFinder = async (type: string) => {
if (!activeThread) return
const activeThreadState = threadStates[activeThread.id]
if (!activeThreadState.isFinishInit) {
alert('Thread is not started yet')
return
// TODO: this logic should be refactored.
if (type !== 'Model') {
if (!activeThread) return
const activeThreadState = threadStates[activeThread.id]
if (!activeThreadState.isFinishInit) {
alert('Thread is not started yet')
return
}
}

const userSpace = await getJanDataFolderPath()
Expand Down Expand Up @@ -44,11 47,14 @@ export const usePath = () => {
}

const onViewJson = async (type: string) => {
if (!activeThread) return
const activeThreadState = threadStates[activeThread.id]
if (!activeThreadState.isFinishInit) {
alert('Thread is not started yet')
return
// TODO: this logic should be refactored.
if (type !== 'Model') {
if (!activeThread) return
const activeThreadState = threadStates[activeThread.id]
if (!activeThreadState.isFinishInit) {
alert('Thread is not started yet')
return
}
}

const userSpace = await getJanDataFolderPath()
Expand Down

0 comments on commit 7df2888

Please sign in to comment.