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
Prev Previous commit
Next Next commit
fix: restore support dotprop access
  • Loading branch information
viva-jinyi committed Aug 22, 2025
commit 31c6273d9035cf55d12d819d58ee3b41f0edb3bf
9 changes: 5 additions & 4 deletions src/scripts/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axios from 'axios'
import { get } from 'es-toolkit/compat'

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

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

/**
* Gets a server feature flag value.
* @param featureName The name of the feature to get
* @param featureName The name of the feature to get (supports dot notation for nested values)
* @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 (this.serverFeatureFlags[featureName] ?? defaultValue) as T
return get(this.serverFeatureFlags, featureName, defaultValue) as T
}

/**
Expand Down
Loading