start indexedDBStore

This commit is contained in:
Ajay Bura 2025-01-17 18:35:01 +05:30
parent a20092d762
commit 4070b97ba1

View file

@ -21,18 +21,21 @@ export const initClient = async (session: Session): Promise<MatrixClient> => {
dbName: 'web-sync-store', dbName: 'web-sync-store',
}); });
const legacyCryptoStore = new IndexedDBCryptoStore(global.indexedDB, 'crypto-store');
const mx = createClient({ const mx = createClient({
baseUrl: session.baseUrl, baseUrl: session.baseUrl,
accessToken: session.accessToken, accessToken: session.accessToken,
userId: session.userId, userId: session.userId,
store: indexedDBStore, store: indexedDBStore,
cryptoStore: new IndexedDBCryptoStore(global.indexedDB, 'crypto-store'), cryptoStore: legacyCryptoStore,
deviceId: session.deviceId, deviceId: session.deviceId,
timelineSupport: true, timelineSupport: true,
cryptoCallbacks: cryptoCallbacks as any, cryptoCallbacks: cryptoCallbacks as any,
verificationMethods: ['m.sas.v1'], verificationMethods: ['m.sas.v1'],
}); });
await indexedDBStore.startup();
await mx.initRustCrypto(); await mx.initRustCrypto();
mx.setGlobalErrorOnUnknownDevices(false); mx.setGlobalErrorOnUnknownDevices(false);