Compare commits

...

2 Commits

4 changed files with 17 additions and 23 deletions

View File

@ -133,23 +133,14 @@ const onKeyShortcut = (e) => {
case 'Delete':
onDelete()
return
case 'd':
if (e.metaKey && isMacOS()) {
onDelete()
}
return
case 'F5':
onReload()
return
case 'r':
if (e.metaKey && isMacOS()) {
onReload()
}
return
case 'F2':
onRename()
return

View File

@ -154,7 +154,11 @@ const onAdd = async () => {
value = defaultValue[type]
}
// await browserStore.reloadKey({server, db, key: trim(key)})
const { success, msg, nodeKey } = await browserStore.setKey({
const {
success,
msg,
nodeKey = '',
} = await browserStore.setKey({
server,
db,
key: trim(key),
@ -165,8 +169,11 @@ const onAdd = async () => {
if (success) {
// select current key
await nextTick()
tabStore.setSelectedKeys(server, nodeKey)
browserStore.reloadKey({ server, db, key })
const selectedDB = browserStore.getSelectedDB(server)
if (selectedDB === db) {
tabStore.setSelectedKeys(server, nodeKey)
browserStore.reloadKey({ server, db, key })
}
} else if (!isEmpty(msg)) {
$message.error(msg)
}

View File

@ -355,11 +355,6 @@ const onKeyShortcut = (e) => {
case 'Delete':
handleKeyDelete()
break
case 'd':
if (e.metaKey && isMacOS()) {
handleKeyDelete()
}
break
case 'F5':
handleSelectContextMenu('value_reload')
break

View File

@ -832,7 +832,7 @@ const useBrowserStore = defineStore('browser', {
if (success) {
/** @type RedisServerState **/
const serverInst = this.servers[server]
if (serverInst != null) {
if (serverInst != null && serverInst.db === db) {
// const { value } = data
// update tree view data
const { newKey = 0 } = serverInst.addKeyNodes([key], true)
@ -840,11 +840,12 @@ const useBrowserStore = defineStore('browser', {
serverInst.tidyNode(key)
serverInst.updateDBKeyCount(db, newKey)
}
}
const { value: updatedValue } = data
if (updatedValue != null) {
const tab = useTabStore()
tab.updateValue({ server, db, key, value: updatedValue })
const { value: updatedValue } = data
if (updatedValue != null) {
const tab = useTabStore()
tab.updateValue({ server, db, key, value: updatedValue })
}
}
// this.loadKeySummary({ server, db, key })
return {