Skip to content

Commit faef954

Browse files
committed
feat: keep plugin hotkeys active inside data manager
1 parent e2ddf2d commit faef954

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/views/DataManageModal.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Modal } from 'obsidian';
1+
import { Modal, Scope } from 'obsidian';
22
import type CubicJBrewingPlugin from '../main';
33
import { t } from '../i18n/index';
44
import { BeanManagePanel } from './dataManage/BeanManagePanel';
@@ -22,6 +22,11 @@ export class DataManageModal extends Modal {
2222

2323
constructor(plugin: CubicJBrewingPlugin) {
2424
super(plugin.app);
25+
this.scope = new Scope(plugin.app.scope);
26+
this.scope.register([], 'Escape', () => {
27+
this.close();
28+
return false;
29+
});
2530
this.beanPanel = new BeanManagePanel({
2631
app: plugin.app,
2732
vaultData: plugin.vaultData,

0 commit comments

Comments
 (0)