Skip to content

Commit

Permalink
Merge branch 'wordplaydev:main' into 378-translate-the-verse
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidxuwuhu authored Aug 18, 2024
2 parents a8cc819 + 3b4b515 commit ec4a1ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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
5 changes: 3 additions & 2 deletions src/routes/project/[projectid]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@
// See if the project is editable, and if so, get it's store, so we can track it's changes.
const projectStore = Projects.getStore(projectID);
if (projectStore) {
// Mark the project editable, since there's a store for it.
editable = true;
// If there's a different store, stop listening to the current store and listen to the new one.
if (store !== projectStore) {
// Unsubscribe from the previous store
if (unsub) unsub();
// Mark the project editable.
// Remember the new store
store = projectStore;
// Update the project we're showing whenever it changes.
unsub = store.subscribe((proj) => {
project = proj;
overwritten =
Projects.getHistory(
proj.getID()
proj.getID(),
)?.wasOverwritten() ?? false;
});
}
Expand Down

0 comments on commit ec4a1ca

Please sign in to comment.