quick fix

This commit is contained in:
Dustin Loring 2024-12-15 14:06:37 -05:00
parent 51347edd28
commit b5c8d43d9e
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ import {
isLocalModelsEnabled, isLocalModelsEnabled,
LOCAL_PROVIDERS, LOCAL_PROVIDERS,
providersStore, providersStore,
useLatestBranch, latestBranch,
} from '~/lib/stores/settings'; } from '~/lib/stores/settings';
import { useCallback, useEffect, useState } from 'react'; import { useCallback, useEffect, useState } from 'react';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
@ -22,7 +22,7 @@ export function useSettings() {
const debug = useStore(isDebugMode); const debug = useStore(isDebugMode);
const eventLogs = useStore(isEventLogsEnabled); const eventLogs = useStore(isEventLogsEnabled);
const isLocalModel = useStore(isLocalModelsEnabled); const isLocalModel = useStore(isLocalModelsEnabled);
const useLatest = useStore(useLatestBranch); const useLatest = useStore(latestBranch);
const [activeProviders, setActiveProviders] = useState<ProviderInfo[]>([]); const [activeProviders, setActiveProviders] = useState<ProviderInfo[]>([]);
// Function to check if we're on stable version // Function to check if we're on stable version
@ -90,11 +90,11 @@ export function useSettings() {
// If setting hasn't been set by user, check version // If setting hasn't been set by user, check version
checkIsStableVersion().then(isStable => { checkIsStableVersion().then(isStable => {
const shouldUseLatest = !isStable; const shouldUseLatest = !isStable;
useLatestBranch.set(shouldUseLatest); latestBranch.set(shouldUseLatest);
Cookies.set('useLatestBranch', String(shouldUseLatest)); Cookies.set('useLatestBranch', String(shouldUseLatest));
}); });
} else { } else {
useLatestBranch.set(savedLatestBranch === 'true'); latestBranch.set(savedLatestBranch === 'true');
} }
}, []); }, []);
@ -148,7 +148,7 @@ export function useSettings() {
}, []); }, []);
const enableLatestBranch = useCallback((enabled: boolean) => { const enableLatestBranch = useCallback((enabled: boolean) => {
useLatestBranch.set(enabled); latestBranch.set(enabled);
logStore.logSystem(`Main branch updates ${enabled ? 'enabled' : 'disabled'}`); logStore.logSystem(`Main branch updates ${enabled ? 'enabled' : 'disabled'}`);
Cookies.set('useLatestBranch', String(enabled)); Cookies.set('useLatestBranch', String(enabled));
}, []); }, []);

View File

@ -47,4 +47,4 @@ export const isEventLogsEnabled = atom(false);
export const isLocalModelsEnabled = atom(true); export const isLocalModelsEnabled = atom(true);
export const useLatestBranch = atom(false); export const latestBranch = atom(false);