mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
disable export button if no non-default presets
This commit is contained in:
parent
526e0f30a0
commit
4e294f9e3e
@ -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,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user