Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-byrne committed Feb 7, 2025
1 parent 074bdba commit ce44947
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hooks/remoteWidgetHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface CacheEntry<T> {

const dataCache = new Map<string, CacheEntry<any>>()

const getCacheKey = (inputData: InputSpec): string => {
const createCacheKey = (inputData: InputSpec): string => {
const { route, query_params = {}, refresh = 0 } = inputData[1]

const paramsKey = Object.entries(query_params)
Expand Down Expand Up @@ -47,7 +47,7 @@ async function fetchData<T>(
export function useRemoteWidget<T>(inputData: InputSpec) {
const { refresh = 0 } = inputData[1]
const isPermanent = refresh <= 0
const cacheKey = getCacheKey(inputData)
const cacheKey = createCacheKey(inputData)
const defaultValue = useWidgetStore().getDefaultValue(inputData)

const setSuccess = (entry: CacheEntry<T>, data: T[]) => {
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,12 +562,12 @@ export const ComfyWidgets: Record<string, ComfyWidgetConstructor> = {
COMBO(node, inputName, inputData: InputSpec) {
const widgetStore = useWidgetStore()

const { type } = inputData[1]
const { type, options } = inputData[1]
const defaultValue = widgetStore.getDefaultValue(inputData)

const res = {
widget: node.addWidget('combo', inputName, defaultValue, () => {}, {
values: inputData[1].options ?? inputData[0]
values: options ?? inputData[0]
})
}

Expand Down

0 comments on commit ce44947

Please sign in to comment.