Add finally handler for rename tree node action (#1403)

* Add finally handler for rename tree node action

* nit
This commit is contained in:
Chenlei Hu
2024-11-02 11:39:15 -04:00
committed by GitHub
parent caa3ac2068
commit cc420b70a5
4 changed files with 21 additions and 13 deletions

View File

@@ -39,7 +39,6 @@ import { useI18n } from 'vue-i18n'
import { useTreeExpansion } from '@/hooks/treeHooks'
import { app } from '@/scripts/app'
import { findNodeByKey } from '@/utils/treeUtil'
import { useErrorHandling } from '@/hooks/errorHooks'
const props = defineProps<{
filteredNodeDefs: ComfyNodeDefImpl[]
@@ -212,13 +211,11 @@ defineExpose({
addNewBookmarkFolder
})
const handleRename = useErrorHandling().wrapWithErrorHandling(
(node: TreeNode, newName: string) => {
if (node.data && node.data.isDummyFolder) {
nodeBookmarkStore.renameBookmarkFolder(node.data, newName)
}
const handleRename = (node: TreeNode, newName: string) => {
if (node.data && node.data.isDummyFolder) {
nodeBookmarkStore.renameBookmarkFolder(node.data, newName)
}
)
}
const showCustomizationDialog = ref(false)
const initialIcon = ref(nodeBookmarkStore.defaultBookmarkIcon)