Merge pull request #3989 from janhq/fix/windows-import-name-issue
fix: Model import name and ID are incorrect on Windows
This commit is contained in:
commit
4cd0208bb9
@ -61,6 +61,9 @@ async function checkAndMigrateTheme(
|
||||
)
|
||||
if (existingTheme) {
|
||||
const desTheme = join(janDataThemesFolder, existingTheme)
|
||||
if (!lstatSync(desTheme).isDirectory()) {
|
||||
return
|
||||
}
|
||||
console.debug('Updating theme', existingTheme)
|
||||
rmdirSync(desTheme, { recursive: true })
|
||||
cpSync(sourceThemePath, join(janDataThemesFolder, sourceThemeName), {
|
||||
|
||||
@ -5,11 +5,11 @@ import {
|
||||
ImportingModel,
|
||||
LocalImportModelEvent,
|
||||
Model,
|
||||
ModelEvent,
|
||||
ModelExtension,
|
||||
OptionType,
|
||||
events,
|
||||
fs,
|
||||
baseName,
|
||||
} from '@janhq/core'
|
||||
|
||||
import { atom, useSetAtom } from 'jotai'
|
||||
@ -61,8 +61,8 @@ const useImportModel = () => {
|
||||
|
||||
const importModels = useCallback(
|
||||
(models: ImportingModel[], optionType: OptionType) => {
|
||||
models.map((model) => {
|
||||
const modelId = model.modelId ?? model.path.split('/').pop()
|
||||
models.map(async (model) => {
|
||||
const modelId = model.modelId ?? (await baseName(model.path))
|
||||
if (modelId) {
|
||||
addDownloadingModel(modelId)
|
||||
extensionManager
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
"react": "18.2.0",
|
||||
"react-circular-progressbar": "^2.1.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-dropzone": "^14.2.3",
|
||||
"react-dropzone": "14.2.3",
|
||||
"react-hook-form": "^7.47.0",
|
||||
"react-hot-toast": "^2.4.1",
|
||||
"react-icons": "^4.12.0",
|
||||
|
||||
@ -306,7 +306,8 @@ const Advanced = () => {
|
||||
})
|
||||
}
|
||||
// Stop any running model to apply the changes
|
||||
if (e.target.checked !== gpuEnabled) stopModel()
|
||||
if (e.target.checked !== gpuEnabled)
|
||||
stopModel().then(() => window.core?.api?.relaunch())
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user