From dc3421c34e40e6a95eeb7bb5db11bd2b6dcb95b3 Mon Sep 17 00:00:00 2001 From: Paulo Victor Cordeiro <146781332+pvcordeiro@users.noreply.github.com> Date: Wed, 3 Jun 2026 00:12:37 +0100 Subject: [PATCH] fix: return sorted model list on first call in group chat (#1484) Both _getModels() and getAllModels() store the sorted copy in a cache variable but return the original unsorted array on first invocation. Subsequent calls return the cache (sorted), causing inconsistent model picker ordering on first render. --- static/js/group.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/group.js b/static/js/group.js index 1784911..4390b00 100644 --- a/static/js/group.js +++ b/static/js/group.js @@ -58,7 +58,7 @@ function _initGroupTab() { }); }); _modelsCache = sortModelObjects(result); - return result; + return _modelsCache; } function _render() { @@ -410,7 +410,7 @@ export async function showModelPicker() { }); }); _cachedModels = sortModelObjects(result); - return result; + return _cachedModels; } async function render(filter) {