fix m direct updated with other account data

This commit is contained in:
Ajay Bura 2024-05-07 18:27:06 +05:30
parent e230a0316e
commit b14dccbc8a

View file

@ -30,10 +30,12 @@ export const useBindMDirectAtom = (mx: MatrixClient, mDirect: typeof mDirectAtom
} }
const handleAccountData = (event: MatrixEvent) => { const handleAccountData = (event: MatrixEvent) => {
setMDirect({ if (event.getType() === AccountDataEvent.Direct) {
type: 'UPDATE', setMDirect({
rooms: getMDirects(event), type: 'UPDATE',
}); rooms: getMDirects(event),
});
}
}; };
mx.on(ClientEvent.AccountData, handleAccountData); mx.on(ClientEvent.AccountData, handleAccountData);