mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 23:10:28 +03:00
Add option to create muliple pin spaces shortcut
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
9ffc4eaa40
commit
4ab2af51a5
2 changed files with 12 additions and 2 deletions
|
|
@ -71,8 +71,15 @@ class AccountData extends EventEmitter {
|
|||
accountActions(action) {
|
||||
const actions = {
|
||||
[cons.actions.accountData.CREATE_SPACE_SHORTCUT]: () => {
|
||||
if (this.spaceShortcut.has(action.roomId)) return;
|
||||
this.spaceShortcut.add(action.roomId);
|
||||
const addRoomId = (id) => {
|
||||
if (this.spaceShortcut.has(id)) return;
|
||||
this.spaceShortcut.add(id);
|
||||
};
|
||||
if (Array.isArray(action.roomId)) {
|
||||
action.roomId.forEach(addRoomId);
|
||||
} else {
|
||||
addRoomId(action.roomId);
|
||||
}
|
||||
this._updateSpaceShortcutData([...this.spaceShortcut]);
|
||||
this.emit(cons.events.accountData.SPACE_SHORTCUT_UPDATED, action.roomId);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue