Skip to content

Commit

Permalink
Fixed #452, prevented aggressive local project persistence.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Apr 27, 2024
1 parent 16f0266 commit 7f9a176
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http:

- [#450](https://github.com/wordplaydev/wordplay/issues/450) Tutorial typos!
- [#444](https://github.com/wordplaydev/wordplay/issues/444) Fixed fullscreen background behavior.
- [#452](https://github.com/wordplaydev/wordplay/issues/452) Fixed aggressive local project persistence causing slowdown.
- Removed `Toggle.svelte` background color when off.
- Restored preferred spacing on `CodeView`.
- Removed padding from `ConceptLinkUI` for better guide typography.
Expand All @@ -18,6 +19,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http:
- Only highlight definitions and uses of caret position when inside a token.
- Fixed incorrect placement of caret; it was assuming pretty printing.
- Removed unused font preload.
- Less aggressive local project persistence

### Maintenance

Expand Down
8 changes: 5 additions & 3 deletions src/db/ProjectsDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default class ProjectsDatabase {
project.isTutorial()
? PersistenceType.Local
: PersistenceType.Online,
false,
true,
);
}

Expand Down Expand Up @@ -529,10 +529,12 @@ export default class ProjectsDatabase {
const userID = this.database.getUserID();

const editable = Array.from(this.projectHistories.values());
// Only save unsaved local projects.
const local = editable.filter(
(history) =>
history.getPersisted() === PersistenceType.Local ||
history.getPersisted() === PersistenceType.Online,
history.isUnsaved() &&
(history.getPersisted() === PersistenceType.Local ||
history.getPersisted() === PersistenceType.Online),
);
const online = editable.filter(
(history) => history.getPersisted() === PersistenceType.Online,
Expand Down

0 comments on commit 7f9a176

Please sign in to comment.