fixes for ai and iamge related models bacekedn

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-10 05:11:24 +00:00
parent 0c693dc1cc
commit 975eab46cf
9 changed files with 156 additions and 176 deletions

View File

@@ -87,23 +87,8 @@ export default function SiteList() {
}, []);
const loadUserPreferences = async () => {
try {
const { fetchAccountSetting } = await import('../../services/api');
const setting = await fetchAccountSetting('user_preferences');
const preferences = setting.config as { selectedIndustry?: string; selectedSectors?: string[] } | undefined;
if (preferences) {
setUserPreferences(preferences);
}
} catch (error: any) {
// 404 means preferences don't exist yet - that's fine
// 500 and other errors should be handled silently - user can still use the page
if (error?.status === 404) {
// Preferences don't exist yet - this is expected for new users
return;
}
// Silently handle other errors (500, network errors, etc.) - don't spam console
// User can still use the page without preferences
}
// User preferences are now loaded from site/account data, not from a separate endpoint
// This function is kept for backward compatibility but does nothing
};
useEffect(() => {

View File

@@ -433,16 +433,8 @@ export default function SiteSettings() {
};
const loadUserPreferences = async () => {
try {
const { fetchAccountSetting } = await import('../../services/api');
const setting = await fetchAccountSetting('user_preferences');
const preferences = setting.config as { selectedIndustry?: string; selectedSectors?: string[] } | undefined;
if (preferences) {
setUserPreferences(preferences);
}
} catch (error: any) {
// Silently handle errors
}
// User preferences are now loaded from site/account data, not from a separate endpoint
// This function is kept for backward compatibility but does nothing
};
const loadSiteSectors = async () => {
@@ -947,7 +939,7 @@ export default function SiteSettings() {
<SelectDropdown
options={qualityTiers.length > 0
? qualityTiers.map(tier => ({
value: tier.value,
value: tier.tier || tier.value,
label: `${tier.label} (${tier.credits} credits)`
}))
: [
@@ -956,7 +948,7 @@ export default function SiteSettings() {
{ value: 'premium', label: 'Premium (15 credits)' },
]
}
value={selectedTier}
value={selectedTier || 'quality'}
onChange={(value) => setSelectedTier(value)}
className="w-full"
/>
@@ -987,11 +979,11 @@ export default function SiteSettings() {
<div>
<Label className="mb-2">Images per Article</Label>
<SelectDropdown
options={Array.from({ length: 4 }, (_, i) => ({
options={Array.from({ length: maxAllowed || 8 }, (_, i) => ({
value: String(i + 1),
label: `${i + 1} image${i > 0 ? 's' : ''}`,
}))}
value={String(maxImages)}
value={String(maxImages || 4)}
onChange={(value) => setMaxImages(parseInt(value))}
className="w-full"
/>