Skip to content

Commit

Permalink
Fix #1753
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Jun 27, 2023
1 parent 0d1404b commit 9286841
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions samples/dexie-cloud-todo-app/src/db/TodoList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ export class TodoList extends Entity<TodoDB> {
// Delete the list
db.todoLists.delete(this.id!);

// Delete any tied realm and related access:
// Delete any tied realm and related access.
// If it wasn't shared, this is a no-op but do
// it anyway to make this operation consistent
// in case it was shared by other offline
// client and then syncs.
// No need to delete members - they will be deleted
// automatically when the realm is deleted.
const tiedRealmId = getTiedRealmId(this.id);
db.members.where({ realmId: tiedRealmId }).delete();
db.realms.delete(tiedRealmId);
}
);
Expand Down

0 comments on commit 9286841

Please sign in to comment.