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:
committed by
GitHub
parent
1f743970dd
commit
dc3421c34e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user