Add hotkey ctrl+k for search
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
@@ -12,6 +12,8 @@ class Navigation extends EventEmitter {
|
||||
|
||||
this.selectedRoomId = null;
|
||||
this.recentRooms = [];
|
||||
|
||||
this.isRawModalVisible = false;
|
||||
}
|
||||
|
||||
_setSpacePath(roomId) {
|
||||
@@ -38,13 +40,16 @@ class Navigation extends EventEmitter {
|
||||
addRecentRoom(roomId) {
|
||||
if (typeof roomId !== 'string') return;
|
||||
|
||||
this.removeRecentRoom(roomId);
|
||||
this.recentRooms.push(roomId);
|
||||
if (this.recentRooms.length > 10) {
|
||||
this.recentRooms.splice(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
setIsRawModalVisible(visible) {
|
||||
this.isRawModalVisible = visible;
|
||||
}
|
||||
|
||||
navigate(action) {
|
||||
const actions = {
|
||||
[cons.actions.navigation.SELECT_TAB]: () => {
|
||||
@@ -69,6 +74,7 @@ class Navigation extends EventEmitter {
|
||||
[cons.actions.navigation.SELECT_ROOM]: () => {
|
||||
const prevSelectedRoomId = this.selectedRoomId;
|
||||
this.selectedRoomId = action.roomId;
|
||||
this.removeRecentRoom(prevSelectedRoomId);
|
||||
this.addRecentRoom(prevSelectedRoomId);
|
||||
this.removeRecentRoom(this.selectedRoomId);
|
||||
this.emit(
|
||||
|
||||
Reference in New Issue
Block a user