Add openrouter

This commit is contained in:
Joey Yakimowich-Payne 2026-01-15 12:28:51 -07:00
commit 36b686bbd4
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
8 changed files with 380 additions and 61 deletions

View file

@ -6,6 +6,7 @@ import { COLOR_SCHEMES } from '../types';
const DEFAULT_PREFERENCES: UserPreferences = {
colorScheme: 'blue',
aiProvider: 'gemini',
};
export const applyColorScheme = (schemeId: string) => {
@ -42,7 +43,10 @@ export const useUserPreferences = (): UseUserPreferencesReturn => {
const data = await response.json();
const prefs: UserPreferences = {
colorScheme: data.colorScheme || 'blue',
aiProvider: data.aiProvider || 'gemini',
geminiApiKey: data.geminiApiKey || undefined,
openRouterApiKey: data.openRouterApiKey || undefined,
openRouterModel: data.openRouterModel || undefined,
};
setPreferences(prefs);
setHasAIAccess(data.hasAIAccess || false);