Skip to content

Commit

Permalink
fix(manager): plugins cannot be dragged into empty groups
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Jun 17, 2022
1 parent e668129 commit 5aaa234
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"dependencies": {
"@koishijs/utils": "^5.4.5",
"cordis": "^1.5.0",
"cordis": "^1.5.1",
"fastest-levenshtein": "^1.0.12",
"minato": "^1.2.0"
}
Expand Down
4 changes: 3 additions & 1 deletion plugins/frontend/manager/client/settings/tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ interface Node {
}
function allowDrop(source: Node, target: Node, type: 'inner' | 'prev' | 'next') {
return type === 'inner' ? !target.isLeaf : target.data.path !== ''
if (type !== 'inner') return target.data.path !== ''
const segments = target.data.path.split('/')
return segments[segments.length - 1].startsWith('group:')
}
function handleClick(tree: Tree) {
Expand Down

0 comments on commit 5aaa234

Please sign in to comment.