Skip to content

Commit

Permalink
debugging ssr issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mrosack committed Dec 12, 2023
1 parent fa5c097 commit 8807f6f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions _sls_lambda_universal/serverless.yml
Expand Up @@ -11,15 +11,16 @@ provider:
stage: dev
environment:
ROLLBAR_SERVER_API_KEY: ${env:ROLLBAR_SERVER_API_KEY}
ROLLBAR_ENV: ${opt:stage, self:provider.stage}

custom:
apigwBinary:
types:
- '*/*'
- "*/*"

functions:
api:
handler: pydt-universal.handler
events:
- http: GET /{proxy+}
- http: GET /
- http: GET /
2 changes: 1 addition & 1 deletion src/app/shared/error.service.ts
Expand Up @@ -27,7 +27,7 @@ export class ErrorHandlerService implements ErrorHandler {
captureUnhandledRejections: true,
enabled: !!process.env["ROLLBAR_SERVER_API_KEY"],
payload: {
environment: environment.name,
environment: process.env["ROLLBAR_ENV"] || environment.name,
client: {
javascript: {
// eslint-disable-next-line camelcase
Expand Down
Expand Up @@ -17,7 +17,7 @@
</p>
</div>
</ng-container>
<div *ngIf="isBrowser && displayCharts" class="col-md-12">
<div *ngIf="displayCharts" class="col-md-12">
<tabset>
<tab heading="Turn Length">
<pydt-turn-length-chart [turnData]="turnData"></pydt-turn-length-chart>
Expand Down
Expand Up @@ -2,7 +2,6 @@ import { Component, Input } from "@angular/core";
import moment from "moment";
import { TurnData } from "pydt-shared";
import { Utility } from "../../shared/utility";
import { BrowserDataService } from "../../shared/browser-data.service";

@Component({
selector: "pydt-turn-stats",
Expand All @@ -15,12 +14,6 @@ export class DisplayTurnStatsComponent {
@Input() hideQueueCharts = false;
@Input() factWidth = 6;

constructor(private browserData: BrowserDataService) {}

get isBrowser() {
return this.browserData.isBrowser();
}

get firstTurnAgo() {
return Utility.countdownAgo(this.turnData.firstTurnEndDate, null);
}
Expand Down
@@ -1,3 +1,4 @@
<div [style.width]="smallMode ? '80px' : '100%'" [style.height]="smallMode ? '32px' : '200px'">
<canvas baseChart [data]="chartData" [options]="chartOptions" [legend]="false" [type]="'bar'"> </canvas>
<canvas *ngIf="isBrowser" baseChart [data]="chartData" [options]="chartOptions" [legend]="false" [type]="'bar'">
</canvas>
</div>
Expand Up @@ -2,6 +2,7 @@ import { Component, Input, OnChanges } from "@angular/core";
import { TURN_BUCKETS, TurnData } from "pydt-shared";
import { ChartConfiguration } from "chart.js";
import { Utility } from "../../shared/utility";
import { BrowserDataService } from "../../../app/shared/browser-data.service";

@Component({
selector: "pydt-turn-length-chart",
Expand All @@ -20,6 +21,12 @@ export class TurnLengthChartComponent implements OnChanges {
animation: false,
};

isBrowser = false;

constructor(browserData: BrowserDataService) {
this.isBrowser = browserData.isBrowser();
}

ngOnChanges(): void {
const turnLengthColors = [
"#00FF00",
Expand Down

0 comments on commit 8807f6f

Please sign in to comment.