Skip to content

Commit

Permalink
Ensure owned projects are marked as owned when loaded directly from F…
Browse files Browse the repository at this point in the history
…irestore.
  • Loading branch information
amyjko committed Aug 11, 2024
1 parent cd473d6 commit 3b4b515
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
We'll note all notable changes in this file, including bug fixes, enhancements, and all closed issues.
Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http://semver.org/) format.

## 0.10.10 2024-08-12

### Fixed

- [#550](https://github.com/wordplaydev/wordplay/issues/550) Ensure owned projects are marked as owned when loaded directly from Firestore.

## 0.10.9 2024-08-10

### Added
Expand Down
6 changes: 4 additions & 2 deletions src/db/ProjectsDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default class ProjectsDatabase {
this.projectsQueryUnsubscribe = undefined;
}

// If there's no more user, stop le, do nothing.
// If there's no more user, do nothing.
if (user === null) return;

// Set up the realtime projects query for the user, tracking any projects from the cloud,
Expand Down Expand Up @@ -430,11 +430,13 @@ export default class ProjectsDatabase {
doc(firestore, ProjectsCollection, id),
);
if (projectDoc.exists()) {
const user = this.database.getUser();

const project = await this.parseProject(projectDoc.data());
if (project !== undefined)
this.track(
project,
false,
user !== null && project.getOwner() === user.uid,
PersistenceType.Online,
false,
);
Expand Down

0 comments on commit 3b4b515

Please sign in to comment.