Skip to content

Commit

Permalink
fix: update wrong main view state when use a model (janhq#861)
Browse files Browse the repository at this point in the history
Signed-off-by: James <[email protected]>
Co-authored-by: James <[email protected]>
  • Loading branch information
namchuai and James authored Dec 5, 2023
1 parent 848bdbc commit aa8e700
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/screens/ExploreModels/ExploreModelItemHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@ const ExploreModelItemHeader: React.FC<Props> = ({ model, onClick, open }) => {
<Button onClick={() => onDownloadClick()}>Download</Button>
)

const onUseModelClick = () => {
startModel(model.id)
setMainViewState(MainViewState.Thread)
}

if (isDownloaded) {
downloadButton = (
<Button
themes="success"
className="min-w-[98px]"
onClick={() => {
startModel(model.id)
setMainViewState(MainViewState.MyModels)
}}
onClick={onUseModelClick}
>
Use
</Button>
Expand Down

0 comments on commit aa8e700

Please sign in to comment.