mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 15:00:30 +03:00
Add hotkey ctrl+k for search
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
413188c995
commit
fbeecc0479
5 changed files with 52 additions and 32 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue