Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(store): switch from JSON to YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReincarnator committed Dec 13, 2017
1 parent a52b4cb commit 0b8b5c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class Store {
this.patternRoot.addTextPattern();

(this.projects as IObservableArray<Project>).clear();
const projectsPath = PathUtils.join(this.getPagesPath(), 'projects.json');
const projectsPath = PathUtils.join(this.getPagesPath(), 'projects.yaml');
const projectsJsonObject: JsonObject = Persister.loadYamlOrJson(projectsPath);
(projectsJsonObject.projects as JsonArray).forEach((projectJson: JsonObject) => {
const project: Project = Project.fromJsonObject(projectJson, this);
Expand All @@ -102,7 +102,7 @@ export class Store {

public openPage(id: string): void {
MobX.transaction(() => {
const pagePath: string = PathUtils.join(this.getPagesPath(), `page-${id}.json`);
const pagePath: string = PathUtils.join(this.getPagesPath(), `page-${id}.yaml`);
const json: JsonObject = Persister.loadYamlOrJson(pagePath);
this.currentPage = Page.fromJsonObject(json, id, this);

Expand Down
2 changes: 1 addition & 1 deletion src/store/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class Page {
}

public save(): void {
const pagePath: string = PathUtils.join(this.store.getPagesPath(), `page-${this.id}.json`);
const pagePath: string = PathUtils.join(this.store.getPagesPath(), `page-${this.id}.yaml`);
const jsonObject: JsonObject = this.toJsonObject();
Persister.saveYaml(pagePath, jsonObject);
}
Expand Down

0 comments on commit 0b8b5c9

Please sign in to comment.