fix: model import name and id is wrong on Windows
This commit is contained in:
parent
244d3d10dc
commit
19879ef279
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user