Skip to content

Commit

Permalink
Model selector should give better information to what is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdjohnson committed Apr 19, 2024
1 parent 2399f7d commit a0d2c89
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/components/ModelSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,29 @@ import ChevronDown from '~/icons/ChevronDown'
import { settingStore } from '~/models/SettingStore'

const ModelSelector = observer(() => {
const { selectedModelLabel, isAnyServerConnected } = settingStore
const {
selectedModelLabel,
isAnyServerConnected,
isA1111ServerConnected,
isServerConnected,
isImageGenerationMode,
} = settingStore
const noServer = !isAnyServerConnected

const label = useMemo(() => {
if (noServer) {
return 'Server not connected'
return 'No Servers connected'
}

return selectedModelLabel || 'No models available'
if (!isA1111ServerConnected && isImageGenerationMode) {
return 'No a1111 models available'
}

if (!isServerConnected) {
return 'No models available'
}

return selectedModelLabel
}, [noServer, selectedModelLabel])

return (
Expand Down

0 comments on commit a0d2c89

Please sign in to comment.