clear active thread state on logout

This commit is contained in:
Ajay Bura 2025-11-03 15:28:52 +05:30
parent 3d4c91c969
commit b5fd41f862

View file

@ -2,6 +2,7 @@ import { createClient, MatrixClient, IndexedDBStore, IndexedDBCryptoStore } from
import { cryptoCallbacks } from './secretStorageKeys'; import { cryptoCallbacks } from './secretStorageKeys';
import { clearNavToActivePathStore } from '../app/state/navToActivePath'; import { clearNavToActivePathStore } from '../app/state/navToActivePath';
import { clearRoomToActiveThreadStore } from '../app/state/roomToActiveThread';
type Session = { type Session = {
baseUrl: string; baseUrl: string;
@ -49,6 +50,7 @@ export const startClient = async (mx: MatrixClient) => {
export const clearCacheAndReload = async (mx: MatrixClient) => { export const clearCacheAndReload = async (mx: MatrixClient) => {
mx.stopClient(); mx.stopClient();
clearNavToActivePathStore(mx.getSafeUserId()); clearNavToActivePathStore(mx.getSafeUserId());
clearRoomToActiveThreadStore(mx.getSafeUserId());
await mx.store.deleteAllData(); await mx.store.deleteAllData();
window.location.reload(); window.location.reload();
}; };