feature/comparison-slider #19

Merged
ilia merged 129 commits from feature/comparison-slider into main 2026-02-02 09:23:46 +00:00
Showing only changes of commit 1bd2a4f2f8 - Show all commits

View File

@@ -12,7 +12,15 @@ export class FontshareStore extends BaseFontStore<FontshareParams> {
} }
protected getQueryKey(params: FontshareParams) { protected getQueryKey(params: FontshareParams) {
return ['fontshare', params] as const; // Normalize params to treat empty arrays/strings as undefined
const normalized = Object.entries(params).reduce((acc, [key, value]) => {
if (value === '' || (Array.isArray(value) && value.length === 0)) {
return acc;
}
return { ...acc, [key]: value };
}, {});
return ['fontshare', normalized] as const;
} }
protected async fetchFn(params: FontshareParams): Promise<UnifiedFont[]> { protected async fetchFn(params: FontshareParams): Promise<UnifiedFont[]> {