Skip to content

Commit

Permalink
feat: 增加快捷键获取兜底
Browse files Browse the repository at this point in the history
  • Loading branch information
moshangqi committed Nov 17, 2023
1 parent 8e8988a commit 9cc13a6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/core/bridge/background/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ export function createUserBridge(impl: ICallBridgeImpl) {
BackgroundEvents.OperateUser,
{ type: OperateUserEnum.getUserShortCut },
res => {
const map: IShortcutMap = {};
for (const item of res) {
if (item.name === '_execute_action') {
map.openSidePanel = item.shortcut;
} else {
map[item.name as keyof IShortcutMap] = item.shortcut;
try {
const map: IShortcutMap = {};
for (const item of res) {
if (item.name === '_execute_action') {
map.openSidePanel = item.shortcut;
} else {
map[item.name as keyof IShortcutMap] = item.shortcut;
}
}
resolve(map);
} catch (error) {
resolve({});
}
resolve(map);
},
);
});
Expand Down

0 comments on commit 9cc13a6

Please sign in to comment.