mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-19 12:10:17 +09:00
Fix provider comparison issue in model comparison
Fixed an issue where comparing models using the provider object directly resulted in errors. Changed to compare provider.id to ensure the comparison is based on a unique identifier, accurately determining if the models are the same. If the provider comparison fails, more models will be stored in persistStore. Although this issue is not immediately visible in the frontend due to subsequent processing, it leads to increased memory usage and longer startup times with each page reload.
This commit is contained in:
parent
3809375694
commit
e83f2bad84
@ -203,7 +203,7 @@ export const useAppConfig = createPersistStore(
|
||||
const models = currentState.models.slice();
|
||||
state.models.forEach((pModel) => {
|
||||
const idx = models.findIndex(
|
||||
(v) => v.name === pModel.name && v.provider === pModel.provider,
|
||||
(v) => v.name === pModel.name && v.provider.id === pModel.provider.id,
|
||||
);
|
||||
if (idx !== -1) models[idx] = pModel;
|
||||
else models.push(pModel);
|
||||
|
Loading…
Reference in New Issue
Block a user