mirror of
				https://github.com/cinnyapp/cinny.git
				synced 2025-11-04 06:20:28 +03:00 
			
		
		
		
	clear active thread state on logout
This commit is contained in:
		
							parent
							
								
									3d4c91c969
								
							
						
					
					
						commit
						b5fd41f862
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2,6 +2,7 @@ import { createClient, MatrixClient, IndexedDBStore, IndexedDBCryptoStore } from
 | 
			
		|||
 | 
			
		||||
import { cryptoCallbacks } from './secretStorageKeys';
 | 
			
		||||
import { clearNavToActivePathStore } from '../app/state/navToActivePath';
 | 
			
		||||
import { clearRoomToActiveThreadStore } from '../app/state/roomToActiveThread';
 | 
			
		||||
 | 
			
		||||
type Session = {
 | 
			
		||||
  baseUrl: string;
 | 
			
		||||
| 
						 | 
				
			
			@ -49,6 +50,7 @@ export const startClient = async (mx: MatrixClient) => {
 | 
			
		|||
export const clearCacheAndReload = async (mx: MatrixClient) => {
 | 
			
		||||
  mx.stopClient();
 | 
			
		||||
  clearNavToActivePathStore(mx.getSafeUserId());
 | 
			
		||||
  clearRoomToActiveThreadStore(mx.getSafeUserId());
 | 
			
		||||
  await mx.store.deleteAllData();
 | 
			
		||||
  window.location.reload();
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue