mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 23:10:28 +03:00
Add function to move space shortcut
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
faaac72b81
commit
a7a5b08ad8
3 changed files with 20 additions and 0 deletions
|
|
@ -89,6 +89,17 @@ class AccountData extends EventEmitter {
|
|||
this._updateSpaceShortcutData([...this.spaceShortcut]);
|
||||
this.emit(cons.events.accountData.SPACE_SHORTCUT_UPDATED, action.roomId);
|
||||
},
|
||||
[cons.actions.accountData.MOVE_SPACE_SHORTCUTS]: () => {
|
||||
const { roomId, toIndex } = action;
|
||||
if (!this.spaceShortcut.has(roomId)) return;
|
||||
this.spaceShortcut.delete(roomId);
|
||||
const ssList = [...this.spaceShortcut];
|
||||
if (toIndex >= ssList.length) ssList.push(roomId);
|
||||
else ssList.splice(toIndex, 0, roomId);
|
||||
this.spaceShortcut = new Set(ssList);
|
||||
this._updateSpaceShortcutData(ssList);
|
||||
this.emit(cons.events.accountData.SPACE_SHORTCUT_UPDATED, roomId);
|
||||
},
|
||||
[cons.actions.accountData.CATEGORIZE_SPACE]: () => {
|
||||
if (this.categorizedSpaces.has(action.roomId)) return;
|
||||
this.categorizedSpaces.add(action.roomId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue