You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Split KeyAction into multiple enums
This gives some additional type safety and makes enum member usage more clear.
This commit is contained in:
@@ -78,7 +78,7 @@ import Notifier from "../../Notifier";
|
||||
import { showToast as showNotificationsToast } from "../../toasts/DesktopNotificationsToast";
|
||||
import { RoomNotificationStateStore } from "../../stores/notifications/RoomNotificationStateStore";
|
||||
import { Container, WidgetLayoutStore } from "../../stores/widgets/WidgetLayoutStore";
|
||||
import { getKeyBindingsManager, KeyAction, KeyBindingContext } from '../../KeyBindingsManager';
|
||||
import { getKeyBindingsManager, RoomAction } from '../../KeyBindingsManager';
|
||||
|
||||
const DEBUG = false;
|
||||
let debuglog = function(msg: string) {};
|
||||
@@ -661,18 +661,18 @@ export default class RoomView extends React.Component<IProps, IState> {
|
||||
private onReactKeyDown = ev => {
|
||||
let handled = false;
|
||||
|
||||
const action = getKeyBindingsManager().getAction(KeyBindingContext.Room, ev);
|
||||
const action = getKeyBindingsManager().getRoomAction(ev);
|
||||
switch (action) {
|
||||
case KeyAction.RoomDismissReadMarker:
|
||||
case RoomAction.DismissReadMarker:
|
||||
this.messagePanel.forgetReadMarker();
|
||||
this.jumpToLiveTimeline();
|
||||
handled = true;
|
||||
break;
|
||||
case KeyAction.RoomScrollUp:
|
||||
case RoomAction.ScrollUp:
|
||||
this.jumpToReadMarker();
|
||||
handled = true;
|
||||
break;
|
||||
case KeyAction.RoomUploadFile:
|
||||
case RoomAction.UploadFile:
|
||||
dis.dispatch({ action: "upload_file" }, true);
|
||||
handled = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user