Skip to content

Commit

Permalink
Merge pull request #4470 from janhq/fix/app-crashes-on-select-cloud-m…
Browse files Browse the repository at this point in the history
…odel-first-time-onboarding

fix: app crashes on select cloud model first time onboarding
  • Loading branch information
louis-jan authored Jan 16, 2025
2 parents b9ea4ba + 1affa5a commit df6110b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 31 deletions.
2 changes: 2 additions & 0 deletions web/screens/Settings/Engines/RemoteEngineSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ const RemoteEngineSettings = ({
}
}, [engine])

if (!engine) return null

return (
<ScrollArea className="h-full w-full">
<div className="block w-full px-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,40 +298,46 @@ const OnDeviceStarterScreen = ({ isShowStarterScreen }: Props) => {
key={rowIndex}
className="my-2 flex items-center gap-4 md:gap-10"
>
{row.map((remoteEngine) => {
const engineLogo = getLogoEngine(
remoteEngine as InferenceEngine
{row
.filter(
(e) =>
engines?.[e as InferenceEngine]?.[0]?.type ===
'remote'
)
.map((remoteEngine) => {
const engineLogo = getLogoEngine(
remoteEngine as InferenceEngine
)

return (
<div
className="flex cursor-pointer flex-col items-center justify-center gap-4"
key={remoteEngine}
onClick={() => {
setMainViewState(MainViewState.Settings)
setSelectedSetting(
remoteEngine as InferenceEngine
)
}}
>
{engineLogo && (
<Image
width={48}
height={48}
src={engineLogo}
alt="Engine logo"
className="h-10 w-10 flex-shrink-0"
/>
)}

<p className="font-medium">
{getTitleByEngine(
remoteEngine as InferenceEngine
return (
<div
className="flex cursor-pointer flex-col items-center justify-center gap-4"
key={remoteEngine}
onClick={() => {
setMainViewState(MainViewState.Settings)
setSelectedSetting(
remoteEngine as InferenceEngine
)
}}
>
{engineLogo && (
<Image
width={48}
height={48}
src={engineLogo}
alt="Engine logo"
className="h-10 w-10 flex-shrink-0"
/>
)}
</p>
</div>
)
})}

<p className="font-medium">
{getTitleByEngine(
remoteEngine as InferenceEngine
)}
</p>
</div>
)
})}
</div>
)
})}
Expand Down

0 comments on commit df6110b

Please sign in to comment.