Fix the mechanical lint groups and delete the unused bindings. [skip build]
This commit is contained in:
@@ -131,33 +131,6 @@ const getAllIndexedDBNames = async (): Promise<string[]> => {
|
||||
return [];
|
||||
};
|
||||
|
||||
const deleteAllMatrixDatabases = async (): Promise<void> => {
|
||||
console.log('[initMatrix] Clearing all Matrix-related IndexedDB databases...');
|
||||
|
||||
const dbNames = await getAllIndexedDBNames();
|
||||
console.log('[initMatrix] Found databases:', dbNames);
|
||||
|
||||
// Delete all Matrix-related databases (with matrix-js-sdk: prefix)
|
||||
const matrixDbNames = dbNames.filter(
|
||||
(name) =>
|
||||
name.startsWith('matrix-js-sdk:') ||
|
||||
name.startsWith('crypto@') ||
|
||||
name.startsWith('sync@') ||
|
||||
name === 'crypto-store' ||
|
||||
name === 'web-sync-store',
|
||||
);
|
||||
|
||||
console.log('[initMatrix] Deleting Matrix databases:', matrixDbNames);
|
||||
|
||||
for (const dbName of matrixDbNames) {
|
||||
try {
|
||||
await deleteIndexedDB(dbName);
|
||||
} catch (error) {
|
||||
console.error(`[initMatrix] Failed to delete ${dbName}:`, error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete the Rust crypto database to fix one-time key conflicts.
|
||||
* This happens when the local crypto state has keys that conflict with server state.
|
||||
@@ -284,7 +257,7 @@ export const initClient = async (session: Session): Promise<MatrixClient> => {
|
||||
localStorage.removeItem('cinny_fix_key_conflict');
|
||||
console.log('[initMatrix] ✅ Crypto database cleared');
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
localStorage.removeItem('cinny_fix_key_conflict');
|
||||
}
|
||||
}
|
||||
@@ -450,9 +423,6 @@ export const logoutClient = async (mx: MatrixClient) => {
|
||||
}
|
||||
await mx.clearStores();
|
||||
|
||||
// Import sessions management
|
||||
const { sessionsAtom, currentSessionAtom, getSessionByUserId, getCurrentSession } =
|
||||
await import('../app/state/sessions');
|
||||
const { getLocalStorageItem, setLocalStorageItem } =
|
||||
await import('../app/state/utils/atomWithLocalStorage');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user