Refactor cd to changeDetectorRef (#118)

pull/120/head
Thomas 3 years ago committed by GitHub
parent 0d6fe4a232
commit 95bcdea69b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,7 @@ export class AppComponent implements OnDestroy, OnInit {
private unsubscribeSubject = new Subject<void>();
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private deviceService: DeviceDetectorService,
private materialCssVarsService: MaterialCssVarsService,
@ -80,7 +80,7 @@ export class AppComponent implements OnDestroy, OnInit {
this.user = null;
}
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}

@ -28,7 +28,7 @@ export class PerformanceChartDialog {
public title: string;
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
public dialogRef: MatDialogRef<PerformanceChartDialog>,
@Inject(MAT_DIALOG_DATA) public data: PositionDetailDialogParams
@ -75,7 +75,7 @@ export class PerformanceChartDialog {
}
});
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.title = `Performance vs. ${this.benchmarkLabel}`;

@ -34,7 +34,7 @@ export class PositionDetailDialog {
public transactionCount: number;
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
public dialogRef: MatDialogRef<PositionDetailDialog>,
@Inject(MAT_DIALOG_DATA) public data: PositionDetailDialogParams
@ -127,7 +127,7 @@ export class PositionDetailDialog {
this.benchmarkDataItems[0].value = this.averagePrice;
}
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
);
}

@ -25,7 +25,7 @@ export class AboutPageComponent implements OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private userService: UserService
) {}
@ -39,7 +39,7 @@ export class AboutPageComponent implements OnInit {
if (state?.user) {
this.user = state.user;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
}

@ -28,7 +28,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private userService: UserService
) {
@ -55,7 +55,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
permissions.updateUserSettings
);
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
}
@ -85,7 +85,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
.subscribe((user) => {
this.user = user;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
});
}
@ -102,7 +102,7 @@ export class AccountPageComponent implements OnDestroy, OnInit {
.subscribe((response) => {
this.accesses = response;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}
}

@ -35,7 +35,7 @@ export class AccountsPageComponent implements OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private deviceService: DeviceDetectorService,
private dialog: MatDialog,
@ -90,7 +90,7 @@ export class AccountsPageComponent implements OnInit {
permissions.deleteAccount
);
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
@ -105,7 +105,7 @@ export class AccountsPageComponent implements OnInit {
this.router.navigate([], { queryParams: { createDialog: true } });
}
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}

@ -32,7 +32,7 @@ export class AdminPageComponent implements OnInit {
public constructor(
private adminService: AdminService,
private cacheService: CacheService,
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private userService: UserService
) {}
@ -139,7 +139,7 @@ export class AdminPageComponent implements OnInit {
this.transactionCount = transactionCount;
this.userCount = userCount;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
);
}

@ -40,7 +40,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private deviceService: DeviceDetectorService,
private impersonationStorageService: ImpersonationStorageService,
@ -66,7 +66,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
.subscribe((response) => {
this.portfolioItems = response;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.dataService
@ -76,7 +76,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
this.portfolioPositions = response;
this.initializeAnalysisData(this.portfolioPositions, this.period);
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.userService.stateChanged
@ -85,7 +85,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
if (state?.user) {
this.user = state.user;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
}

@ -58,7 +58,7 @@ export class HomePageComponent implements OnDestroy, OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private deviceService: DeviceDetectorService,
private dialog: MatDialog,
@ -94,7 +94,7 @@ export class HomePageComponent implements OnDestroy, OnInit {
.subscribe(({ marketPrice }) => {
this.fearAndGreedIndex = marketPrice;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}
@ -103,7 +103,7 @@ export class HomePageComponent implements OnDestroy, OnInit {
permissions.readForeignPortfolio
);
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
}
@ -169,7 +169,7 @@ export class HomePageComponent implements OnDestroy, OnInit {
};
});
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.dataService
@ -178,14 +178,14 @@ export class HomePageComponent implements OnDestroy, OnInit {
this.performance = response;
this.isLoadingPerformance = false;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.dataService.fetchPortfolioOverview().subscribe((response) => {
this.overview = response;
this.isLoadingOverview = false;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.dataService
@ -195,9 +195,9 @@ export class HomePageComponent implements OnDestroy, OnInit {
this.hasPositions =
this.positions && Object.keys(this.positions).length > 0;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
}

@ -26,7 +26,7 @@ export class LoginPageComponent implements OnDestroy, OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private dialog: MatDialog,
private router: Router,
@ -42,7 +42,7 @@ export class LoginPageComponent implements OnDestroy, OnInit {
this.initializeLineChart();
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}

@ -16,7 +16,7 @@ export class ShowAccessTokenDialog {
public isAgreeButtonDisabled = true;
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
@Inject(MAT_DIALOG_DATA) public data: any
) {}
@ -26,7 +26,7 @@ export class ShowAccessTokenDialog {
setTimeout(() => {
this.isAgreeButtonDisabled = false;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}, 1500);
}
}

@ -21,7 +21,7 @@ export class PricingPageComponent implements OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private userService: UserService
) {}
@ -35,7 +35,7 @@ export class PricingPageComponent implements OnInit {
if (state?.user) {
this.user = state.user;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
}

@ -20,7 +20,7 @@ export class ReportPageComponent implements OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService
) {}
@ -38,7 +38,7 @@ export class ReportPageComponent implements OnInit {
portfolioReport.rules['currencyClusterRisk'] || null;
this.feeRules = portfolioReport.rules['fees'] || null;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}

@ -42,7 +42,7 @@ export class CreateOrUpdateTransactionDialog {
private unsubscribeSubject = new Subject<void>();
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
public dialogRef: MatDialogRef<CreateOrUpdateTransactionDialog>,
@Inject(MAT_DIALOG_DATA) public data: CreateOrUpdateTransactionDialogParams
@ -73,7 +73,7 @@ export class CreateOrUpdateTransactionDialog {
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ marketPrice }) => {
this.currentMarketPrice = marketPrice;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}
}
@ -100,7 +100,7 @@ export class CreateOrUpdateTransactionDialog {
this.isLoading = false;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}

@ -35,7 +35,7 @@ export class TransactionsPageComponent implements OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private deviceService: DeviceDetectorService,
private dialog: MatDialog,
@ -90,7 +90,7 @@ export class TransactionsPageComponent implements OnInit {
permissions.deleteOrder
);
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
@ -105,7 +105,7 @@ export class TransactionsPageComponent implements OnInit {
this.router.navigate([], { queryParams: { createDialog: true } });
}
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
}

@ -31,7 +31,7 @@ export class ZenPageComponent implements OnDestroy, OnInit {
* @constructor
*/
public constructor(
private cd: ChangeDetectorRef,
private changeDetectorRef: ChangeDetectorRef,
private dataService: DataService,
private deviceService: DeviceDetectorService,
private impersonationStorageService: ImpersonationStorageService,
@ -48,7 +48,7 @@ export class ZenPageComponent implements OnDestroy, OnInit {
permissions.readForeignPortfolio
);
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
});
}
@ -86,7 +86,7 @@ export class ZenPageComponent implements OnDestroy, OnInit {
};
});
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.dataService
@ -95,9 +95,9 @@ export class ZenPageComponent implements OnDestroy, OnInit {
this.performance = response;
this.isLoadingPerformance = false;
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
});
this.cd.markForCheck();
this.changeDetectorRef.markForCheck();
}
}

Loading…
Cancel
Save