Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit cbab660

Browse files
committed
Cleanup console errors and extra console logs
1 parent 595ebfb commit cbab660

File tree

7 files changed

+26
-34
lines changed

7 files changed

+26
-34
lines changed

src/components/app-blog-card/app-blog-card.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export class AppBlogCard {
1010
@Prop() blogPost: BlogPost;
1111

1212
componentDidLoad() {
13-
console.log('blog data', this.blogPost);
1413
document.querySelectorAll('meta[property="og:image"]')[0].setAttribute('content', this.blogPost.featured_image); //set opengraph metadata to match Butter CMS featured image
1514
}
1615

src/components/app-blog-content/app-blog-content.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ export class AppBlogContent {
1010
@Prop() blogPost: BlogPost;
1111

1212
componentDidLoad() {
13-
console.log('blog content', this.blogPost);
14-
console.log(this.blogPost.author);
15-
1613
if (Build.isBrowser) {
1714
this.handleIcons();
1815
window.addEventListener('resize', this.handleIcons);

src/components/app-blog-featured/app-blog-featured.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import { formatDate } from '../../shared/date-format';
99
export class AppBlogFeatured {
1010
@Prop() blogPost: BlogPost;
1111

12-
componentDidLoad() {
13-
console.log('blog data', this.blogPost);
14-
}
12+
componentDidLoad() {}
1513

1614
render() {
1715
const publishDate = new Date(this.blogPost.published);

src/components/app-slider/app-slider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export class AppSlider {
1010
@Event() valueChanged: EventEmitter;
1111

1212
inputHandler(event) {
13-
console.log('app-slider value', event.target.value);
1413
this.valueChanged.emit({
1514
field: this.name,
1615
value: event.target.value,

src/pages/app-blog-post/app-blog-post.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ export class AppBlogPost {
2626

2727
@Watch('match')
2828
watchHandler(newValue: any, oldValue: any) {
29+
if (!newValue || !oldValue) {
30+
return;
31+
}
2932
if (newValue.params.slug !== oldValue.params.slug) {
3033
this.getPostContent();
3134
this.filterNextPosts(newValue.params.slug);
3235
}
3336
}
3437

3538
componentDidLoad() {
36-
if(!Build.isBrowser) {
39+
if (!Build.isBrowser) {
3740
this.setMetaTags();
3841
}
3942
}
@@ -46,18 +49,16 @@ export class AppBlogPost {
4649
const pageSize = 12;
4750
if (Build.isBrowser) {
4851
this.nextPostsIsLoading = true;
49-
Fetch.fetchPostContent(1, pageSize, true)
50-
.then(resp => {
51-
if (resp.data) {
52-
this.otherPosts = resp.data;
53-
this.filterNextPosts(this.match.params.slug);
54-
this.nextPostsHelper = this.renderPosts(this.nextPosts, this.nextPostsIsLoading, this.nextPostsIsError);
55-
} else {
56-
this.nextPostsIsError = true;
57-
this.nextPostsHelper = this.renderPosts(this.nextPosts, this.nextPostsIsLoading, this.nextPostsIsError);
58-
console.log(resp);
59-
}
60-
});
52+
Fetch.fetchPostContent(1, pageSize, true).then(resp => {
53+
if (resp.data) {
54+
this.otherPosts = resp.data;
55+
this.filterNextPosts(this.match.params.slug);
56+
this.nextPostsHelper = this.renderPosts(this.nextPosts, this.nextPostsIsLoading, this.nextPostsIsError);
57+
} else {
58+
this.nextPostsIsError = true;
59+
this.nextPostsHelper = this.renderPosts(this.nextPosts, this.nextPostsIsLoading, this.nextPostsIsError);
60+
}
61+
});
6162
this.nextPostsIsLoading = false;
6263
}
6364
}
@@ -70,16 +71,15 @@ export class AppBlogPost {
7071
this.setMetaTags();
7172
} else {
7273
this.blogPostIsLoading = true;
73-
Fetch.fetchPostWithSlug(this.match.params.slug)
74-
.then(resp => {
75-
if (resp) {
76-
this.blogPost = resp.data;
77-
// set scroll to top for when navigating to a new blog post
78-
window.scrollTo(0, 0);
79-
this.setMetaTags();
80-
} else {
81-
this.blogPostIsError = true;
82-
}
74+
Fetch.fetchPostWithSlug(this.match.params.slug).then(resp => {
75+
if (resp) {
76+
this.blogPost = resp.data;
77+
// set scroll to top for when navigating to a new blog post
78+
window.scrollTo(0, 0);
79+
this.setMetaTags();
80+
} else {
81+
this.blogPostIsError = true;
82+
}
8383
});
8484
this.blogPostIsLoading = false;
8585
}

src/pages/app-blog/app-blog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export class AppBlog {
129129
}
130130

131131
handleSearch(query) {
132-
console.log(query);
133132
this.searchQuery = query;
134133
if (this.searchQuery) {
135134
this.getSearchPosts(1);

src/pages/app-contact/app-contact.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, State, Listen, Prop, h, Build } from '@stencil/core';
1+
import { Component, State, Listen, Prop, h } from '@stencil/core';
22
import { translate } from '../../services/translation.service';
33

44
@Component({
@@ -52,7 +52,7 @@ export class AppContact {
5252

5353
private className;
5454
componentWillLoad() {
55-
this.className = Build.isBrowser ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
55+
this.className = 'webp';
5656
}
5757

5858
componentDidLoad() {

0 commit comments

Comments
 (0)