Skip to content

Commit 6e8f864

Browse files
refactor: simplify importSources array construction and unexport type
- Use ternary operator instead of spread for clearer intent - Make ImportSourceType internal (not exported) since it's only used within the module
1 parent 0d0c4d7 commit 6e8f864

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/platform/assets/composables/useUploadModelWizard.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ export function useUploadModelWizard(modelTypes: Ref<ModelTypeOption[]>) {
4646
const selectedModelType = ref<string>()
4747

4848
// Available import sources
49-
const importSources: ImportSource[] = [
50-
civitaiImportSource,
51-
...(flags.huggingfaceModelImportEnabled ? [huggingfaceImportSource] : [])
52-
]
49+
const importSources: ImportSource[] = flags.huggingfaceModelImportEnabled
50+
? [civitaiImportSource, huggingfaceImportSource]
51+
: [civitaiImportSource]
5352

5453
// Detected import source based on URL
5554
const detectedSource = computed(() => {

src/platform/assets/types/importSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Supported model import sources
33
*/
4-
export type ImportSourceType = 'civitai' | 'huggingface'
4+
type ImportSourceType = 'civitai' | 'huggingface'
55

66
/**
77
* Configuration for a model import source

0 commit comments

Comments
 (0)