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:
parent
1f743970dd
commit
dc3421c34e
1 changed files with 2 additions and 2 deletions
|
|
@ -58,7 +58,7 @@ function _initGroupTab() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
_modelsCache = sortModelObjects(result);
|
_modelsCache = sortModelObjects(result);
|
||||||
return result;
|
return _modelsCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
function _render() {
|
function _render() {
|
||||||
|
|
@ -410,7 +410,7 @@ export async function showModelPicker() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
_cachedModels = sortModelObjects(result);
|
_cachedModels = sortModelObjects(result);
|
||||||
return result;
|
return _cachedModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function render(filter) {
|
async function render(filter) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue