Skip to content

Commit f5417ab

Browse files
committed
Removing change detection on push on brew and bean, cause images/flow profiles are not loading correctly.
But for this we remove the loading spinner
1 parent 429b074 commit f5417ab

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

src/components/bean-information/bean-information.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
ChangeDetectionStrategy,
32
Component,
43
ElementRef,
54
EventEmitter,
@@ -48,7 +47,6 @@ import { BEAN_FUNCTION_PIPE_ENUM } from '../../enums/beans/beanFunctionPipe';
4847
selector: 'bean-information',
4948
templateUrl: './bean-information.component.html',
5049
styleUrls: ['./bean-information.component.scss'],
51-
changeDetection: ChangeDetectionStrategy.OnPush,
5250
})
5351
export class BeanInformationComponent implements OnInit {
5452
@Input() public bean: Bean;

src/components/brew-information/brew-information.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
ChangeDetectionStrategy,
32
Component,
43
ElementRef,
54
EventEmitter,
@@ -49,7 +48,6 @@ declare var window;
4948
selector: 'brew-information',
5049
templateUrl: './brew-information.component.html',
5150
styleUrls: ['./brew-information.component.scss'],
52-
changeDetection: ChangeDetectionStrategy.OnPush,
5351
})
5452
export class BrewInformationComponent implements OnInit {
5553
@Input() public brew: Brew;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<ion-spinner *ngIf='flowProfileLoading === true' name="dots"></ion-spinner>
21
<div #canvaContainer>
32
<div #profileDiv></div>
43
</div>

src/components/graph-display-card/graph-display-card.component.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
import { BrewFlow } from '../../classes/brew/brewFlow';
1010
import { Settings } from '../../classes/settings/settings';
1111
import BeanconquerorFlowTestDataDummy from '../../assets/BeanconquerorFlowTestDataFourth.json';
12-
import { TranslateService } from '@ngx-translate/core';
1312
import { UIHelper } from '../../services/uiHelper';
1413
import { UIFileHelper } from '../../services/uiFileHelper';
1514
import { Platform } from '@ionic/angular';
@@ -42,19 +41,16 @@ export class GraphDisplayCardComponent implements OnInit {
4241

4342
public traces: any = {};
4443

45-
public flowProfileLoading: boolean = true;
46-
4744
@ViewChild('canvaContainer', { read: ElementRef, static: true })
4845
public canvaContainer: ElementRef;
4946
@ViewChild('profileDiv', { read: ElementRef, static: true })
5047
public profileDiv: ElementRef;
5148
constructor(
52-
private readonly translate: TranslateService,
5349
private readonly uiHelper: UIHelper,
5450
private readonly uiFileHelper: UIFileHelper,
5551
private readonly platform: Platform,
5652
private readonly uiSettingsStorage: UISettingsStorage,
57-
private readonly graphHelper: GraphHelperService
53+
private readonly graphHelper: GraphHelperService,
5854
) {}
5955

6056
public async ngOnInit() {
@@ -65,7 +61,7 @@ export class GraphDisplayCardComponent implements OnInit {
6561
this.flow_profile_raw = this.uiHelper.cloneData(this.flowProfileData);
6662
} else if (this.meticulousHistoryData) {
6763
this.flow_profile_raw = MeticulousDevice.returnBrewFlowForShotData(
68-
this.meticulousHistoryData.data
64+
this.meticulousHistoryData.data,
6965
);
7066
}
7167
setTimeout(() => {
@@ -114,7 +110,7 @@ export class GraphDisplayCardComponent implements OnInit {
114110
true,
115111
chartWidth,
116112
chartHeight,
117-
true
113+
true,
118114
);
119115

120116
return layout;
@@ -129,7 +125,7 @@ export class GraphDisplayCardComponent implements OnInit {
129125
this.traces = this.graphHelper.fillTraces(
130126
this.traces,
131127
graphSettings,
132-
true
128+
true,
133129
);
134130

135131
this.graphHelper.fillDataIntoTraces(this.flow_profile_raw, this.traces);
@@ -151,12 +147,10 @@ export class GraphDisplayCardComponent implements OnInit {
151147
this.profileDiv.nativeElement,
152148
chartData,
153149
layout,
154-
this.getChartConfig()
150+
this.getChartConfig(),
155151
);
156152
this.profileDiv.nativeElement.removeAllListeners();
157153
this.profileDiv.nativeElement.removeAllListeners('plotly_click');
158-
159-
this.flowProfileLoading = false;
160154
}, 100);
161155
}
162156

@@ -165,7 +159,7 @@ export class GraphDisplayCardComponent implements OnInit {
165159
if (this.flowProfilePath !== '') {
166160
try {
167161
const jsonParsed = await this.uiFileHelper.readInternalJSONFile(
168-
this.flowProfilePath
162+
this.flowProfilePath,
169163
);
170164
this.flow_profile_raw = jsonParsed;
171165
} catch (ex) {}

0 commit comments

Comments
 (0)