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) => {
setMDirect({
type: 'UPDATE',
rooms: getMDirects(event),
});
if (event.getType() === AccountDataEvent.Direct) {
setMDirect({
type: 'UPDATE',
rooms: getMDirects(event),
});
}
};
mx.on(ClientEvent.AccountData, handleAccountData);