From 9e9dce44b43d62649c43b5f5f9853dad0ef6d586 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Wed, 26 Jul 2023 20:34:14 +1200 Subject: [PATCH] fix: Embeddings not being sorted alphabetically --- .../features/embedding/components/ParamEmbeddingPopover.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/invokeai/frontend/web/src/features/embedding/components/ParamEmbeddingPopover.tsx b/invokeai/frontend/web/src/features/embedding/components/ParamEmbeddingPopover.tsx index 69d079034a..4eb9a67de2 100644 --- a/invokeai/frontend/web/src/features/embedding/components/ParamEmbeddingPopover.tsx +++ b/invokeai/frontend/web/src/features/embedding/components/ParamEmbeddingPopover.tsx @@ -57,6 +57,11 @@ const ParamEmbeddingPopover = (props: Props) => { }); }); + // Sort Alphabetically + data.sort((a, b) => + a.label && b.label ? (a.label?.localeCompare(b.label) ? -1 : 1) : -1 + ); + return data.sort((a, b) => (a.disabled && !b.disabled ? 1 : -1)); }, [embeddingQueryData, currentMainModel?.base_model]);