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.
This commit is contained in:
Paulo Victor Cordeiro
2026-06-03 00:12:37 +01:00
committed by GitHub
parent 1f743970dd
commit dc3421c34e

View File

@@ -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) {