fix: enable extensions migration (#3442)
This commit is contained in:
parent
aaeb18cd59
commit
cf07465cad
@ -11,7 +11,11 @@ import {
|
|||||||
lstatSync,
|
lstatSync,
|
||||||
} from 'fs'
|
} from 'fs'
|
||||||
import Store from 'electron-store'
|
import Store from 'electron-store'
|
||||||
import { getJanDataFolderPath, appResourcePath } from '@janhq/core/node'
|
import {
|
||||||
|
getJanDataFolderPath,
|
||||||
|
appResourcePath,
|
||||||
|
getJanExtensionsPath,
|
||||||
|
} from '@janhq/core/node'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrates the extensions & themes.
|
* Migrates the extensions & themes.
|
||||||
@ -24,8 +28,9 @@ export async function migrate() {
|
|||||||
if (store.get('migrated_version') !== app.getVersion()) {
|
if (store.get('migrated_version') !== app.getVersion()) {
|
||||||
console.debug('start migration:', store.get('migrated_version'))
|
console.debug('start migration:', store.get('migrated_version'))
|
||||||
|
|
||||||
// if (existsSync(getJanExtensionsPath()))
|
if (existsSync(getJanExtensionsPath()))
|
||||||
// rmdirSync(getJanExtensionsPath(), { recursive: true })
|
rmdirSync(getJanExtensionsPath(), { recursive: true })
|
||||||
|
|
||||||
await migrateThemes()
|
await migrateThemes()
|
||||||
|
|
||||||
store.set('migrated_version', app.getVersion())
|
store.set('migrated_version', app.getVersion())
|
||||||
|
|||||||
@ -82,9 +82,9 @@ export default function useUpdateModelParameters() {
|
|||||||
const defaultContextLength = settingParams.ctx_len
|
const defaultContextLength = settingParams.ctx_len
|
||||||
const defaultMaxTokens = runtimeParams.max_tokens
|
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
|
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 { max_tokens, ...toSaveParams } = runtimeParams
|
||||||
|
|
||||||
const updatedModel = {
|
const updatedModel = {
|
||||||
@ -116,6 +116,8 @@ export default function useUpdateModelParameters() {
|
|||||||
preserveModelFeatureEnabled,
|
preserveModelFeatureEnabled,
|
||||||
updateDownloadedModel,
|
updateDownloadedModel,
|
||||||
setSelectedModel,
|
setSelectedModel,
|
||||||
|
recommendedModel,
|
||||||
|
setRecommendedModel,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user