Compare commits

...

2 Commits

Author SHA1 Message Date
Aihararaです
b065cffb34
Merge e83f2bad84 into 557a2cce35 2025-08-04 10:45:50 +00:00
Aiharara
e83f2bad84 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.
2025-04-29 04:51:14 +08:00

View File

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