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

Commit 326973e

Browse files
committed
fix(app-case-study.tsx): remove force of webp for assets
1 parent 07e968f commit 326973e

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

src/pages/app-case-study/app-case-study.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { Component, Prop } from '@stencil/core';
1+
import { Component } from '@stencil/core';
22

33
@Component({
44
tag: 'app-case-study',
55
styleUrl: 'app-case-study.scss',
66
})
77
export class AppCaseStudy {
8-
@Prop({ context: 'isServer' })
9-
private isServer: boolean;
10-
11-
private className;
12-
componentWillLoad() {
13-
this.className = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
14-
}
8+
private className = localStorage.getItem('allowWebp') === 'true' ? 'webp' : 'hero';
159

1610
scrollToTop() {
1711
const form = document.getElementsByTagName('header')[0];

src/pages/app-resources/app-resources.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { MatchResults, RouterHistory } from '@stencil/router';
77
styleUrl: 'app-resources.scss',
88
})
99
export class AppResources {
10+
private className = localStorage.getItem('allowWebp') === 'true' ? 'webp' : 'hero';
11+
1012
@State() formSubmitted = false;
1113
@State() formSubmitting = false;
1214

@@ -38,10 +40,6 @@ export class AppResources {
3840
};
3941
@Prop() match: MatchResults;
4042
@Prop() history: RouterHistory;
41-
@Prop({ context: 'isServer' })
42-
private isServer: boolean;
43-
44-
private className;
4543

4644
@Listen('check')
4745
@Listen('valueChange')
@@ -54,8 +52,6 @@ export class AppResources {
5452
}
5553

5654
componentWillLoad() {
57-
this.className = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
58-
5955
if (this.match.params.source !== 'pwa-white-paper') {
6056
this.history.push(`/`, {});
6157
}

src/pages/app-team-landing/app-team-landing.tsx

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

@@ -7,10 +7,7 @@ import { translate } from '../../services/translation.service';
77
styleUrl: 'app-team-landing.scss',
88
})
99
export class AppTeamLanding {
10-
@Prop({ context: 'isServer' })
11-
private isServer: boolean;
12-
13-
private allowWebp;
10+
private allowWebp = localStorage.getItem('allowWebp') === 'true' ? true : false;
1411

1512
@Prop() match: MatchResults;
1613
@Prop() history: RouterHistory;
@@ -288,8 +285,6 @@ export class AppTeamLanding {
288285
}
289286

290287
componentWillLoad() {
291-
this.allowWebp = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
292-
293288
if (!this.data[this.match.params.member]) {
294289
this.history.push(`/`, {});
295290
} else {

src/pages/app-toolbox/app-toolbox.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import { Component, Prop } from '@stencil/core';
1+
import { Component } from '@stencil/core';
22

33
@Component({
44
tag: 'app-toolbox',
55
styleUrl: 'app-toolbox.scss',
66
})
77
export class AppToolbox {
8-
@Prop({ context: 'isServer' })
9-
private isServer: boolean;
10-
11-
private className;
12-
componentWillLoad() {
13-
this.className = !this.isServer ? (localStorage.getItem('allowWebp') === 'false' ? 'webp' : 'hero') : 'webp';
14-
}
8+
private className = localStorage.getItem('allowWebp') === 'true' ? 'webp' : 'hero';
159

1610
scrollToForm() {
1711
const form = document.getElementById('second-content');

0 commit comments

Comments
 (0)