Skip to content
Prev Previous commit
Next Next commit
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
  • Loading branch information
luke-mino-altherr committed Dec 17, 2025
commit c8273c64a4effb9d91dcee53fe16ae5ce4b03074
7 changes: 3 additions & 4 deletions src/platform/assets/composables/useUploadModelWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ export function useUploadModelWizard(modelTypes: Ref<ModelTypeOption[]>) {
const selectedModelType = ref<string>()

// Available import sources
const importSources: ImportSource[] = [
civitaiImportSource,
...(flags.huggingfaceModelImportEnabled ? [huggingfaceImportSource] : [])
]
const importSources: ImportSource[] = flags.huggingfaceModelImportEnabled
? [civitaiImportSource, huggingfaceImportSource]
: [civitaiImportSource]

// Detected import source based on URL
const detectedSource = computed(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/assets/types/importSource.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Supported model import sources
*/
export type ImportSourceType = 'civitai' | 'huggingface'
type ImportSourceType = 'civitai' | 'huggingface'

/**
* Configuration for a model import source
Expand Down