diff --git a/frontend/src/objects/redisServerState.js b/frontend/src/objects/redisServerState.js index d7aca37..2024eab 100644 --- a/frontend/src/objects/redisServerState.js +++ b/frontend/src/objects/redisServerState.js @@ -83,7 +83,7 @@ export class RedisServerState { * @param {number} updateVal */ updateDBKeyCount(db, updateVal) { - const dbInst = this.databases[this.db] + const dbInst = this.databases[db] if (dbInst != null) { dbInst.maxKeys = Math.max(0, dbInst.maxKeys + updateVal) } @@ -288,6 +288,11 @@ export class RedisServerState { // clear all key nodes this.nodeMap.clear() this.getRoot() + const dbInst = this.databases[this.db] + if (dbInst != null) { + dbInst.maxKeys = 0 + dbInst.keyCount = 0 + } } else { const keyParts = split(key, this.separator) const totalParts = size(keyParts) diff --git a/frontend/src/stores/browser.js b/frontend/src/stores/browser.js index f47baf0..2579af2 100644 --- a/frontend/src/stores/browser.js +++ b/frontend/src/stores/browser.js @@ -1493,7 +1493,7 @@ const useBrowserStore = defineStore('browser', { */ async deleteKey(server, db, key, soft) { try { - let deleteCount = 0 + let deleteCount = 1 if (soft !== true) { const { data } = await DeleteKey(server, db, key) deleteCount = get(data, 'deleteCount', 0) @@ -1717,7 +1717,6 @@ const useBrowserStore = defineStore('browser', { if (serverInst != null) { // update tree view data serverInst.removeKeyNode() - serverInst.setDBKeyCount(db, 0) } // set tab content empty const tab = useTabStore()