[lint] Enforce @typescript-eslint/no-floating-promises (#3402)

This commit is contained in:
Chenlei Hu
2025-04-11 12:19:22 -04:00
committed by GitHub
parent 59e20964a0
commit dc5d7ea1be
60 changed files with 305 additions and 279 deletions

View File

@@ -129,9 +129,12 @@ const missingModels = computed(() => {
})
})
onBeforeUnmount(() => {
onBeforeUnmount(async () => {
if (doNotAskAgain.value) {
useSettingStore().set('Comfy.Workflow.ShowMissingModelsWarning', false)
await useSettingStore().set(
'Comfy.Workflow.ShowMissingModelsWarning',
false
)
}
})
</script>

View File

@@ -222,13 +222,13 @@ const filterOutdatedPacks = (packs: components['schemas']['Node'][]) =>
watch(
[isUpdateAvailableTab, installedPacks],
() => {
async () => {
if (!isUpdateAvailableTab.value) return
if (!isEmptySearch.value) {
displayPacks.value = filterOutdatedPacks(installedPacks.value)
} else if (!installedPacks.value.length) {
startFetchInstalled()
await startFetchInstalled()
} else {
displayPacks.value = filterOutdatedPacks(installedPacks.value)
}
@@ -238,7 +238,7 @@ watch(
watch(
[isInstalledTab, installedPacks],
() => {
async () => {
if (!isInstalledTab.value) return
if (!isEmptySearch.value) {
@@ -248,7 +248,7 @@ watch(
!installedPacksReady.value &&
!isLoadingInstalled.value
) {
startFetchInstalled()
await startFetchInstalled()
} else {
displayPacks.value = installedPacks.value
}
@@ -258,7 +258,7 @@ watch(
watch(
[isMissingTab, isWorkflowTab, workflowPacks, installedPacks],
() => {
async () => {
if (!isWorkflowTab.value && !isMissingTab.value) return
if (!isEmptySearch.value) {
@@ -270,9 +270,9 @@ watch(
!isLoadingWorkflow.value &&
!workflowPacksReady.value
) {
startFetchWorkflowPacks()
await startFetchWorkflowPacks()
if (isMissingTab.value) {
startFetchInstalled()
await startFetchInstalled()
}
} else {
displayPacks.value = isMissingTab.value

View File

@@ -55,7 +55,7 @@ const { palettes, activePaletteId } = storeToRefs(colorPaletteStore)
const importCustomPalette = async () => {
const palette = await colorPaletteService.importColorPalette()
if (palette) {
settingStore.set('Comfy.ColorPalette', palette.id)
await settingStore.set('Comfy.ColorPalette', palette.id)
}
}
</script>

View File

@@ -22,8 +22,8 @@ import Message from 'primevue/message'
import { useUserStore } from '@/stores/userStore'
const userStore = useUserStore()
const logout = () => {
userStore.logout()
const logout = async () => {
await userStore.logout()
window.location.reload()
}
</script>

View File

@@ -116,44 +116,44 @@ const hasChanges = computed(() => {
return changedExtensions.value.length > 0
})
const updateExtensionStatus = () => {
const updateExtensionStatus = async () => {
const editingDisabledExtensionNames = Object.entries(
editingEnabledExtensions.value
)
.filter(([_, enabled]) => !enabled)
.map(([name]) => name)
settingStore.set('Comfy.Extension.Disabled', [
await settingStore.set('Comfy.Extension.Disabled', [
...extensionStore.inactiveDisabledExtensionNames,
...editingDisabledExtensionNames
])
}
const enableAllExtensions = () => {
const enableAllExtensions = async () => {
extensionStore.extensions.forEach((ext) => {
if (extensionStore.isExtensionReadOnly(ext.name)) return
editingEnabledExtensions.value[ext.name] = true
})
updateExtensionStatus()
await updateExtensionStatus()
}
const disableAllExtensions = () => {
const disableAllExtensions = async () => {
extensionStore.extensions.forEach((ext) => {
if (extensionStore.isExtensionReadOnly(ext.name)) return
editingEnabledExtensions.value[ext.name] = false
})
updateExtensionStatus()
await updateExtensionStatus()
}
const disableThirdPartyExtensions = () => {
const disableThirdPartyExtensions = async () => {
extensionStore.extensions.forEach((ext) => {
if (extensionStore.isCoreExtension(ext.name)) return
editingEnabledExtensions.value[ext.name] = false
})
updateExtensionStatus()
await updateExtensionStatus()
}
const applyChanges = () => {

View File

@@ -18,9 +18,9 @@ import { useSettingStore } from '@/stores/settingStore'
const settingStore = useSettingStore()
const show = computed(() => !settingStore.exists('Comfy.UseNewMenu'))
const handleClose = () => {
const handleClose = async () => {
// Explicitly write the current value to the store.
const currentValue = settingStore.get('Comfy.UseNewMenu')
settingStore.set('Comfy.UseNewMenu', currentValue)
await settingStore.set('Comfy.UseNewMenu', currentValue)
}
</script>

View File

@@ -211,14 +211,14 @@ watchEffect(() => {
}
})
function removeKeybinding(commandData: ICommandData) {
async function removeKeybinding(commandData: ICommandData) {
if (commandData.keybinding) {
keybindingStore.unsetKeybinding(commandData.keybinding)
keybindingService.persistUserKeybindings()
await keybindingService.persistUserKeybindings()
}
}
function captureKeybinding(event: KeyboardEvent) {
async function captureKeybinding(event: KeyboardEvent) {
// Allow the use of keyboard shortcuts when adding keyboard shortcuts
if (!event.shiftKey && !event.altKey && !event.ctrlKey && !event.metaKey) {
switch (event.key) {
@@ -226,7 +226,7 @@ function captureKeybinding(event: KeyboardEvent) {
cancelEdit()
return
case 'Enter':
saveKeybinding()
await saveKeybinding()
return
}
}
@@ -240,7 +240,7 @@ function cancelEdit() {
newBindingKeyCombo.value = null
}
function saveKeybinding() {
async function saveKeybinding() {
if (currentEditingCommand.value && newBindingKeyCombo.value) {
const updated = keybindingStore.updateKeybindingOnCommand(
new KeybindingImpl({
@@ -249,7 +249,7 @@ function saveKeybinding() {
})
)
if (updated) {
keybindingService.persistUserKeybindings()
await keybindingService.persistUserKeybindings()
}
}
cancelEdit()

View File

@@ -97,16 +97,16 @@ const revertChanges = () => {
serverConfigStore.revertChanges()
}
const restartApp = () => {
electronAPI().restartApp()
const restartApp = async () => {
await electronAPI().restartApp()
}
watch(launchArgs, (newVal) => {
settingStore.set('Comfy.Server.LaunchArgs', newVal)
watch(launchArgs, async (newVal) => {
await settingStore.set('Comfy.Server.LaunchArgs', newVal)
})
watch(serverConfigValues, (newVal) => {
settingStore.set('Comfy.Server.ServerConfigValues', newVal)
watch(serverConfigValues, async (newVal) => {
await settingStore.set('Comfy.Server.ServerConfigValues', newVal)
})
const { copyToClipboard } = useCopyToClipboard()

View File

@@ -69,7 +69,7 @@ const formItem = computed(() => {
const settingStore = useSettingStore()
const settingValue = computed(() => settingStore.get(props.setting.id))
const updateSettingValue = (value: any) => {
settingStore.set(props.setting.id, value)
const updateSettingValue = async (value: any) => {
await settingStore.set(props.setting.id, value)
}
</script>

View File

@@ -99,8 +99,8 @@ const handleRestart = async () => {
await useComfyManagerService().rebootComfyUI()
closeDialog()
const onReconnect = () => {
useCommandStore().execute('Comfy.RefreshNodeDefinitions')
const onReconnect = async () => {
await useCommandStore().execute('Comfy.RefreshNodeDefinitions')
comfyManagerStore.clearLogs()
comfyManagerStore.setStale()
}