Skip to content

Commit

Permalink
Merge pull request #500 from joincivil/am9u/dapp/fix-legacy-charter-r…
Browse files Browse the repository at this point in the history
…endering

DApp: Render legacy charter format
  • Loading branch information
am9u committed Oct 8, 2018
2 parents a5b02a5 + 799402d commit 6e764e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/dapp/src/components/listing/ListingCharter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class ListingCharter extends React.Component<ListingCharterProps> {
if (this.props.newsroom && this.props.newsroom.data.charter) {
let newsroomCharter;
try {
newsroomCharter = JSON.parse(this.props.newsroom.data.charter.content.toString()).charter;
// TODO(jon): This is a temporary patch to handle the older charter format. It's needed while we're in transition to the newer schema and should be updated once the dapp is updated to properly handle the new charter
newsroomCharter = (this.props.newsroom.data.charter.content as any).charter;
} catch (ex) {
console.error("charter not formatted correctly");
}
Expand Down
3 changes: 2 additions & 1 deletion packages/dapp/src/components/listing/ListingHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class ListingHeader extends React.Component<ListingHeaderProps> {
let newsroomDescription = "";
if (this.props.newsroom.data.charter) {
try {
newsroomDescription = JSON.parse(this.props.newsroom.data.charter.content.toString()).desc;
// TODO(jon): This is a temporary patch to handle the older charter format. It's needed while we're in transition to the newer schema and should be updated once the dapp is updated to properly handle the new charter
newsroomDescription = (this.props.newsroom.data.charter.content as any).desc;
} catch (ex) {
console.error("charter not formatted correctly");
}
Expand Down
3 changes: 2 additions & 1 deletion packages/dapp/src/components/listinglist/ListingListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class ListingListItemComponent extends React.Component<
let description = "";
if (newsroom!.wrapper.data.charter) {
try {
description = JSON.parse(newsroom!.wrapper.data.charter!.content.toString()).desc;
// TODO(jon): This is a temporary patch to handle the older charter format. It's needed while we're in transition to the newer schema and should be updated once the dapp is updated to properly handle the new charter
description = (newsroom!.wrapper.data.charter!.content as any).desc;
} catch (ex) {
console.error("charter not formatted correctly");
}
Expand Down

0 comments on commit 6e764e9

Please sign in to comment.