disable export button if no non-default presets

This commit is contained in:
Mary Hipp 2024-08-23 13:44:32 -04:00 committed by Mary Hipp Rogers
parent 526e0f30a0
commit 4e294f9e3e

View File

@ -16,9 +16,9 @@ export const StylePresetExportButton = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { presetCount } = useListStylePresetsQuery(undefined, { const { presetCount } = useListStylePresetsQuery(undefined, {
selectFromResult: ({ data }) => { selectFromResult: ({ data }) => {
const userPresets = data?.filter((preset) => preset.type === 'user') ?? EMPTY_ARRAY; const presetsToExport = data?.filter((preset) => preset.type !== 'default') ?? EMPTY_ARRAY;
return { return {
presetCount: userPresets.length, presetCount: presetsToExport.length,
}; };
}, },
}); });