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

Commit

Permalink
feat(store): open first page of a given project
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReincarnator committed Dec 18, 2017
1 parent bc0ff66 commit 3517990
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/store/index.ts
Expand Up @@ -156,12 +156,19 @@ export class Store {
this.savePreferences();
}

public openFirstPage(): void {
public openFirstPage(projectId?: string): void {
if (!this.projects.length) {
return;
}

const pages: PageRef[] = this.projects[0].getPages();
let project: Project = this.projects[0];
this.projects.forEach(candidate => {
if (candidate.getId() === projectId) {
project = candidate;
}
});

const pages: PageRef[] = project.getPages();
if (!pages.length) {
return;
}
Expand Down

0 comments on commit 3517990

Please sign in to comment.