Bugfix: shortcuts stop working

https://github.com/the-djmaze/snappymail/issues/62#issuecomment-810921656
This commit is contained in:
djmaze 2021-07-21 14:14:31 +02:00
parent 319e30265b
commit 5ef49f9b8e

View file

@ -40,19 +40,18 @@ export const keyScope = (()=>{
keyScope(keyScopeFake); keyScope(keyScopeFake);
} }
}); });
return ko.computed({ return value => {
read: () => keyScopeFake, if (value) {
write: value => {
if (Scope.Menu !== value) { if (Scope.Menu !== value) {
keyScopeFake = value; keyScopeFake = value;
if (dropdownVisibility()) { if (dropdownVisibility()) {
value = Scope.Menu; value = Scope.Menu;
} }
} }
keyScopeReal(value); keyScopeReal(value);
shortcuts.setScope(value);
} else {
return keyScopeFake;
} }
}); };
})(); })();
keyScopeReal.subscribe(value => shortcuts.setScope(value));