From e83f2bad84f2402e1d50e438083c7ae16f06c3d4 Mon Sep 17 00:00:00 2001 From: Aiharara Date: Tue, 29 Apr 2025 04:51:14 +0800 Subject: [PATCH] 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. --- app/store/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/config.ts b/app/store/config.ts index 45e21b026..e6c40d83f 100644 --- a/app/store/config.ts +++ b/app/store/config.ts @@ -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);