mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-19 22:34:15 +00:00
[lint] Enforce @typescript-eslint/no-floating-promises (#3402)
This commit is contained in:
@@ -17,14 +17,15 @@ export function setupAutoQueueHandler() {
|
||||
graphHasChanged = true
|
||||
} else {
|
||||
graphHasChanged = false
|
||||
app.queuePrompt(0, queueSettingsStore.batchCount)
|
||||
// Queue the prompt in the background
|
||||
void app.queuePrompt(0, queueSettingsStore.batchCount)
|
||||
internalCount++
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
queueCountStore.$subscribe(
|
||||
() => {
|
||||
async () => {
|
||||
internalCount = queueCountStore.count
|
||||
if (!internalCount && !app.lastExecutionError) {
|
||||
if (
|
||||
@@ -32,7 +33,7 @@ export function setupAutoQueueHandler() {
|
||||
(queueSettingsStore.mode === 'change' && graphHasChanged)
|
||||
) {
|
||||
graphHasChanged = false
|
||||
app.queuePrompt(0, queueSettingsStore.batchCount)
|
||||
await app.queuePrompt(0, queueSettingsStore.batchCount)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -36,8 +36,8 @@ export const useColorPaletteService = () => {
|
||||
throw new Error(`Invalid color palette against zod schema:\n${error}`)
|
||||
}
|
||||
|
||||
const persistCustomColorPalettes = () => {
|
||||
settingStore.set(
|
||||
const persistCustomColorPalettes = async () => {
|
||||
await settingStore.set(
|
||||
'Comfy.CustomColorPalettes',
|
||||
colorPaletteStore.customPalettes
|
||||
)
|
||||
@@ -48,9 +48,9 @@ export const useColorPaletteService = () => {
|
||||
*
|
||||
* @param colorPaletteId - The ID of the color palette to delete.
|
||||
*/
|
||||
const deleteCustomColorPalette = (colorPaletteId: string) => {
|
||||
const deleteCustomColorPalette = async (colorPaletteId: string) => {
|
||||
colorPaletteStore.deleteCustomPalette(colorPaletteId)
|
||||
persistCustomColorPalettes()
|
||||
await persistCustomColorPalettes()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,10 +58,10 @@ export const useColorPaletteService = () => {
|
||||
*
|
||||
* @param colorPalette - The palette to add.
|
||||
*/
|
||||
const addCustomColorPalette = (colorPalette: Palette) => {
|
||||
const addCustomColorPalette = async (colorPalette: Palette) => {
|
||||
validateColorPalette(colorPalette)
|
||||
colorPaletteStore.addCustomPalette(colorPalette)
|
||||
persistCustomColorPalettes()
|
||||
await persistCustomColorPalettes()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -176,14 +176,16 @@ export const useColorPaletteService = () => {
|
||||
const file = await uploadFile('application/json')
|
||||
const text = await file.text()
|
||||
const palette = JSON.parse(text)
|
||||
addCustomColorPalette(palette)
|
||||
await addCustomColorPalette(palette)
|
||||
return palette
|
||||
}
|
||||
|
||||
return {
|
||||
getActiveColorPalette: () => colorPaletteStore.completedActivePalette,
|
||||
addCustomColorPalette: wrapWithErrorHandling(addCustomColorPalette),
|
||||
deleteCustomColorPalette: wrapWithErrorHandling(deleteCustomColorPalette),
|
||||
addCustomColorPalette: wrapWithErrorHandlingAsync(addCustomColorPalette),
|
||||
deleteCustomColorPalette: wrapWithErrorHandlingAsync(
|
||||
deleteCustomColorPalette
|
||||
),
|
||||
loadColorPalette: wrapWithErrorHandlingAsync(loadColorPalette),
|
||||
exportColorPalette: wrapWithErrorHandling(exportColorPalette),
|
||||
importColorPalette: wrapWithErrorHandlingAsync(importColorPalette)
|
||||
|
||||
@@ -65,7 +65,7 @@ export const useExtensionService = () => {
|
||||
if (extension.getCustomWidgets) {
|
||||
// TODO(huchenlei): We should deprecate the async return value of
|
||||
// getCustomWidgets.
|
||||
;(async () => {
|
||||
void (async () => {
|
||||
if (extension.getCustomWidgets) {
|
||||
const widgets = await extension.getCustomWidgets(app)
|
||||
useWidgetStore().registerCustomWidgets(widgets)
|
||||
|
||||
@@ -79,7 +79,7 @@ export const useLitegraphService = () => {
|
||||
this.#addOutputs(ComfyNode.nodeData.outputs)
|
||||
this.#setInitialSize()
|
||||
this.serialize_widgets = true
|
||||
extensionService.invokeExtensionsAsync('nodeCreated', this)
|
||||
void extensionService.invokeExtensionsAsync('nodeCreated', this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user