diff --git a/electron/utils/migration.ts b/electron/utils/migration.ts index 8c8d61a28..52ee45ed0 100644 --- a/electron/utils/migration.ts +++ b/electron/utils/migration.ts @@ -11,7 +11,11 @@ import { lstatSync, } from 'fs' import Store from 'electron-store' -import { getJanDataFolderPath, appResourcePath } from '@janhq/core/node' +import { + getJanDataFolderPath, + appResourcePath, + getJanExtensionsPath, +} from '@janhq/core/node' /** * Migrates the extensions & themes. @@ -24,8 +28,9 @@ export async function migrate() { if (store.get('migrated_version') !== app.getVersion()) { console.debug('start migration:', store.get('migrated_version')) - // if (existsSync(getJanExtensionsPath())) - // rmdirSync(getJanExtensionsPath(), { recursive: true }) + if (existsSync(getJanExtensionsPath())) + rmdirSync(getJanExtensionsPath(), { recursive: true }) + await migrateThemes() store.set('migrated_version', app.getVersion()) diff --git a/web/hooks/useUpdateModelParameters.ts b/web/hooks/useUpdateModelParameters.ts index 838617020..79d877456 100644 --- a/web/hooks/useUpdateModelParameters.ts +++ b/web/hooks/useUpdateModelParameters.ts @@ -82,9 +82,9 @@ export default function useUpdateModelParameters() { const defaultContextLength = settingParams.ctx_len const defaultMaxTokens = runtimeParams.max_tokens - // eslint-disable-next-line @typescript-eslint/naming-convention + // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars const { ctx_len, ...toSaveSettings } = settingParams - // eslint-disable-next-line @typescript-eslint/naming-convention + // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars const { max_tokens, ...toSaveParams } = runtimeParams const updatedModel = { @@ -116,6 +116,8 @@ export default function useUpdateModelParameters() { preserveModelFeatureEnabled, updateDownloadedModel, setSelectedModel, + recommendedModel, + setRecommendedModel, ] )