fix(desktop): gate prompts on provider setup
Show the desktop provider onboarding flow before prompt submission when no inference provider is configured, preventing fresh installs from falling through to backend credential errors.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { atom } from 'nanostores'
|
||||
|
||||
interface DesktopOnboardingState {
|
||||
reason: null | string
|
||||
requested: boolean
|
||||
}
|
||||
|
||||
export const $desktopOnboarding = atom<DesktopOnboardingState>({
|
||||
reason: null,
|
||||
requested: false
|
||||
})
|
||||
|
||||
export function requestDesktopOnboarding(reason = 'No inference provider is configured.') {
|
||||
$desktopOnboarding.set({
|
||||
reason,
|
||||
requested: true
|
||||
})
|
||||
}
|
||||
|
||||
export function completeDesktopOnboarding() {
|
||||
$desktopOnboarding.set({
|
||||
reason: null,
|
||||
requested: false
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user