fix(hot-keys): Set the correct context name to enable hot keys based on the current page (#308)
This commit is contained in:
1 parent
99041bebde
commit
5017fd13af
7 files changed
+25
-16
No files matched your search
@@ -1,2 +1 @@
|
||||
import './components';
|
||||
import './lib';
|
||||
@@ -1 +0,0 @@
|
||||
import './routes';
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Router } from 'meteor/clinical:router';
|
||||
import { Session } from 'meteor/session';
|
||||
import { hotkeys } from 'meteor/ohif:hotkeys';
|
||||
|
||||
Router.onBeforeAction(function() {
|
||||
const lastRoute = Session.get('lastRoute');
|
||||
const currentRoute = this.router.current().route.getName();
|
||||
if (currentRoute !== lastRoute) {
|
||||
hotkeys.switchToContext(null);
|
||||
Session.set('lastRoute', currentRoute);
|
||||
}
|
||||
|
||||
this.next();
|
||||
});
|
||||
Reference in new issue
Block a user