Add keybind hint to confirm close dialog (#2529)

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
bymyself
2025-02-12 08:02:27 -07:00
committed by GitHub
parent 29cd693335
commit bfec9b692b
10 changed files with 33 additions and 6 deletions

View File

@@ -188,14 +188,17 @@ export const useWorkflowService = () => {
*/
const closeWorkflow = async (
workflow: ComfyWorkflow,
options: { warnIfUnsaved: boolean } = { warnIfUnsaved: true }
options: { warnIfUnsaved: boolean; hint?: string } = {
warnIfUnsaved: true
}
): Promise<boolean> => {
if (workflow.isModified && options.warnIfUnsaved) {
const confirmed = await dialogService.confirm({
title: t('sideToolbar.workflowTab.dirtyCloseTitle'),
type: 'dirtyClose',
message: t('sideToolbar.workflowTab.dirtyClose'),
itemList: [workflow.path]
itemList: [workflow.path],
hint: options.hint
})
// Cancel
if (confirmed === null) return false