fix: enable extensions migration (#3442)
This commit is contained in:
parent
aaeb18cd59
commit
cf07465cad
@ -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())
|
||||
|
||||
@ -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,
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user