mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-14 19:20:28 +03:00
Fix bugs in dm tab
This commit is contained in:
parent
b7c322d473
commit
06bae231ef
5 changed files with 86 additions and 110 deletions
|
|
@ -113,17 +113,20 @@ async function join(roomIdOrAlias, isDM, via) {
|
|||
* @param {string} roomId
|
||||
* @param {boolean} isDM
|
||||
*/
|
||||
function leave(roomId) {
|
||||
async function leave(roomId) {
|
||||
const mx = initMatrix.matrixClient;
|
||||
const isDM = initMatrix.roomList.directs.has(roomId);
|
||||
mx.leave(roomId)
|
||||
.then(() => {
|
||||
appDispatcher.dispatch({
|
||||
type: cons.actions.room.LEAVE,
|
||||
roomId,
|
||||
isDM,
|
||||
});
|
||||
}).catch();
|
||||
try {
|
||||
await mx.leave(roomId);
|
||||
await mx.forget(roomId);
|
||||
appDispatcher.dispatch({
|
||||
type: cons.actions.room.LEAVE,
|
||||
roomId,
|
||||
isDM,
|
||||
});
|
||||
} catch {
|
||||
console.error('Unable to leave room.');
|
||||
}
|
||||
}
|
||||
|
||||
async function create(options, isDM = false) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue