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

Commit

Permalink
fix(store): patternId migration path
Browse files Browse the repository at this point in the history
  • Loading branch information
faselbaum committed Mar 12, 2018
1 parent dfd2fde commit c67d58f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/store/page/page-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ export class PageElement {
return;
}

const patternId = json['pattern'] as string;
const pattern: Pattern | undefined = styleguide.getPattern(patternId);
let patternId = json['pattern'] as string;
let pattern: Pattern | undefined = styleguide.getPattern(patternId);

if (!pattern) {
patternId = `${patternId}/index`;
pattern = styleguide.getPattern(patternId);
}

if (!pattern) {
console.warn(`Ignoring unknown pattern "${patternId}"`);
return new PageElement(undefined, false, parent);
Expand Down

0 comments on commit c67d58f

Please sign in to comment.