mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 03:36:01 +00:00
context menu
This commit is contained in:
@@ -30,11 +30,38 @@ export default async function invalidateCommands() {
|
||||
if (!command.isGroupCommand) continue;
|
||||
const groupSources = values.filter(x => x.group == command.group && !x.isGroupCommand && x.enabled);
|
||||
command.enabled = groupSources.length > 0;
|
||||
for(const source of groupSources) {
|
||||
source.keyTextFromGroup = command.keyText;
|
||||
}
|
||||
// for (const source of groupSources) {
|
||||
// source.keyTextFromGroup = command.keyText;
|
||||
// }
|
||||
}
|
||||
}
|
||||
return res || dct;
|
||||
});
|
||||
}
|
||||
|
||||
let isInvalidatedDefinitions = false;
|
||||
|
||||
export async function invalidateCommandDefinitions() {
|
||||
if (isInvalidatedDefinitions) return;
|
||||
isInvalidatedDefinitions = true;
|
||||
await tick();
|
||||
|
||||
isInvalidatedDefinitions = false;
|
||||
|
||||
commands.update(dct => {
|
||||
let res = { ...dct };
|
||||
const values = Object.values(res) as GlobalCommand[];
|
||||
// test enabled for group commands
|
||||
for (const command of values) {
|
||||
if (!command.isGroupCommand) continue;
|
||||
const groupSources = values.filter(x => x.group == command.group && !x.isGroupCommand);
|
||||
|
||||
for (const source of groupSources) {
|
||||
source.keyTextFromGroup = command.keyText;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
});
|
||||
|
||||
invalidateCommands();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user