Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: api.ts file is different with main branch
  • Loading branch information
viva-jinyi committed Aug 21, 2025
commit c29e2f69e0946f7fbaee310412fe2fd19cb3604f
9 changes: 4 additions & 5 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import axios from 'axios'
import get from 'lodash/get'

import defaultClientFeatureFlags from '@/config/clientFeatureFlags.json'
import type {
Expand Down Expand Up @@ -1083,21 +1082,21 @@ export class ComfyApi extends EventTarget {

/**
* Checks if the server supports a specific feature.
* @param featureName The name of the feature to check (supports dot notation for nested values)
* @param featureName The name of the feature to check
* @returns true if the feature is supported, false otherwise
*/
serverSupportsFeature(featureName: string): boolean {
return get(this.serverFeatureFlags, featureName) === true
return this.serverFeatureFlags[featureName] === true
}

/**
* Gets a server feature flag value.
* @param featureName The name of the feature to get (supports dot notation for nested values)
* @param featureName The name of the feature to get
* @param defaultValue The default value if the feature is not found
* @returns The feature value or default
*/
getServerFeature<T = unknown>(featureName: string, defaultValue?: T): T {
return get(this.serverFeatureFlags, featureName, defaultValue) as T
return (this.serverFeatureFlags[featureName] ?? defaultValue) as T
}

/**
Expand Down
Loading