fix: clean selected keys after deleted

This commit is contained in:
Lykin 2024-01-04 00:44:27 +08:00
parent 23087a5374
commit ac6d68d17d
2 changed files with 9 additions and 5 deletions

View File

@ -127,11 +127,13 @@ const onAddKey = () => {
const selectedKey = get(browserTreeRef.value?.getSelectedKey(), 0)
if (selectedKey != null) {
const node = browserStore.getNode(selectedKey)
const { type = ConnectionType.RedisValue, redisKey } = node
if (type === ConnectionType.RedisKey) {
// has prefix
dialogStore.openNewKeyDialog(redisKey, props.server, props.db)
return
if (node != null) {
const { type = ConnectionType.RedisValue, redisKey } = node
if (type === ConnectionType.RedisKey) {
// has prefix
dialogStore.openNewKeyDialog(redisKey, props.server, props.db)
return
}
}
}
dialogStore.openNewKeyDialog('', props.server, props.db)

View File

@ -1526,6 +1526,8 @@ const useBrowserStore = defineStore('browser', {
// set tab content empty
const tab = useTabStore()
tab.emptyTab(server)
tab.setSelectedKeys(server)
tab.setCheckedKeys(server)
return true
} finally {
}