fix: loadCategories error handling and invalid Tailwind opacity fractions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-13 02:34:03 -04:00
parent 69404e0e12
commit 4269aea015
3 changed files with 9 additions and 5 deletions

View File

@@ -11,8 +11,8 @@ function TemplateSkeleton() {
return (
<div className="px-4 py-3 rounded-xl border border-border animate-pulse">
<div className="flex justify-between mb-2">
<div className="h-4 w-2/3 bg-white/8 rounded" />
<div className="h-4 w-14 bg-white/8 rounded" />
<div className="h-4 w-2/3 bg-white/10 rounded" />
<div className="h-4 w-14 bg-white/10 rounded" />
</div>
<div className="h-3 w-full bg-white/5 rounded mb-1" />
<div className="h-3 w-3/4 bg-white/5 rounded" />

View File

@@ -24,7 +24,7 @@ export function TemplateCard({ template }: Props) {
onClick={() => selectTemplate(template.id)}
className={cn(
'w-full text-left px-4 py-3 rounded-xl border transition-all',
'hover:border-white/12 hover:bg-white/4',
'hover:border-[rgba(255,255,255,0.12)] hover:bg-white/5',
isActive
? 'bg-primary/10 border-primary/30 border-l-[3px] border-l-primary'
: 'border-border bg-transparent'

View File

@@ -59,8 +59,12 @@ export const useScriptGeneratorStore = create<ScriptGeneratorState>()((set, get)
generateError: null,
loadCategories: async () => {
const categories = await scriptsApi.getCategories()
set({ categories })
try {
const categories = await scriptsApi.getCategories()
set({ categories })
} catch {
// silently ignore — categories remain empty, UI degrades gracefully
}
},
loadTemplates: async () => {