mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
prepare large merge
This commit is contained in:
parent
8a17c9246b
commit
076e0add44
3 changed files with 5 additions and 4 deletions
|
|
@ -22,7 +22,7 @@ type RefreshableState = ({
|
|||
state: 'refreshing',
|
||||
timeoutId: NodeJS.Timeout | null, // the timeoutId of the most recent call to refreshModels
|
||||
} | {
|
||||
state: 'success',
|
||||
state: 'finished',
|
||||
timeoutId: null,
|
||||
})
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ export class RefreshModelService extends Disposable implements IRefreshModelServ
|
|||
this.voidSettingsService.setSettingOfProvider(providerName, '_enabled', true)
|
||||
}
|
||||
|
||||
this._setRefreshState(providerName, 'success')
|
||||
this._setRefreshState(providerName, 'finished')
|
||||
},
|
||||
onError: ({ error }) => {
|
||||
// poll
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ type FeatureFlagDisplayInfo = {
|
|||
export const displayInfoOfFeatureFlag = (featureFlag: FeatureFlagName): FeatureFlagDisplayInfo => {
|
||||
if (featureFlag === 'autoRefreshModels') {
|
||||
return {
|
||||
description: `Automatically scan for and enable local providers like Ollama.`, // ${`refreshableProviderNames.map(providerName => titleOfProviderName(providerName)).join(', ')`}
|
||||
description: `Automatically enable local providers and models (like Ollama).`, // ${`refreshableProviderNames.map(providerName => titleOfProviderName(providerName)).join(', ')`}
|
||||
}
|
||||
}
|
||||
throw new Error(`featureFlagInfo: Unknown feature flag: "${featureFlag}"`)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ const RefreshModelButton = ({ providerName }: { providerName: RefreshableProvide
|
|||
useCallback((providerName2, refreshModelState) => {
|
||||
if (providerName2 !== providerName) return
|
||||
const { state } = refreshModelState[providerName]
|
||||
if (state !== 'success') return
|
||||
if (state !== 'finished') return
|
||||
// now we know we just entered 'success' state for this providerName
|
||||
setJustSucceeded(true)
|
||||
const tid = setTimeout(() => { setJustSucceeded(false) }, 2000)
|
||||
|
|
@ -354,6 +354,7 @@ export const VoidFeatureFlagSettings = () => {
|
|||
|
||||
return featureFlagNames.map((flagName) => {
|
||||
|
||||
// right now this is just `enabled_autoRefreshModels`
|
||||
const enabled = voidSettingsState.featureFlagSettings[flagName]
|
||||
const { description } = displayInfoOfFeatureFlag(flagName)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue