Skip to content

Commit

Permalink
fix IndexedDBStore API documentation
Browse files Browse the repository at this point in the history
changes the changelog entry to include since when this change is needed

fix matrix-org#3986
  • Loading branch information
WebFreak001 committed Jan 24, 2024
1 parent ffc9fb3 commit 787cb3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/indexeddb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class IndexedDBStore extends MemoryStore {
* ```
* let opts = { indexedDB: window.indexedDB, localStorage: window.localStorage };
* let store = new IndexedDBStore(opts);
* await store.startup(); // load from indexed db
* let client = sdk.createClient({
* store: store,
* });
* await store.startup(); // load from indexed db, must be called after createClient
* client.startClient();
* client.on("sync", function(state, prevState, data) {
* if (state === "PREPARED") {
Expand Down Expand Up @@ -140,7 +140,7 @@ export class IndexedDBStore extends MemoryStore {
logger.log(`IndexedDBStore.startup: processing presence events`);
userPresenceEvents.forEach(([userId, rawEvent]) => {
if (!this.createUser) {
throw new Error("createUser is undefined, it should be set with setUserCreator()!");
throw new Error("`IndexedDBStore.startup` must be called after assigning it to the client, not before!");
}
const u = this.createUser(userId);
if (rawEvent) {
Expand Down

0 comments on commit 787cb3a

Please sign in to comment.