Skip to content

Commit

Permalink
chore: fix typescript errors from newer parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoramite committed Nov 1, 2021
1 parent 61a4c90 commit eafe215
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/ts/editor/ui/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {LazyUiParts} from './parts';
import {OnboardingStatus} from '../api';
import {EVENT_RENDER as SELECTIVE_EVENT_RENDER} from '@blinkk/selective-edit/dist/selective/events';
import TimeAgo from 'javascript-time-ago';
import en from 'javascript-time-ago/locale/en';
import en from 'javascript-time-ago/locale/en.json';
import {templateLoading} from '../template';

// Set the default locale for the time ago globally.
Expand Down
2 changes: 1 addition & 1 deletion src/ts/projectType/amagaki/amagakiState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class AmagakiState extends BaseProjectTypeState {
callbackError?: (error: ApiError) => void
): Record<string, PartialData> | undefined | null {
const promiseKey = AmagakiStatePromiseKeys.GetPartials;
if (this.promises[promiseKey]) {
if (promiseKey in this.promises) {
return this.partials;
}
this.promises[promiseKey] = this.api.projectTypes.amagaki
Expand Down
4 changes: 2 additions & 2 deletions src/ts/projectType/grow/growState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class GrowState extends BaseProjectTypeState {
callbackError?: (error: ApiError) => void
): Record<string, PartialData> | undefined | null {
const promiseKey = GrowStatePromiseKeys.GetPartials;
if (this.promises[promiseKey]) {
if (promiseKey in this.promises) {
return this.partials;
}
this.promises[promiseKey] = this.api.projectTypes.grow
Expand All @@ -54,7 +54,7 @@ export class GrowState extends BaseProjectTypeState {
callbackError?: (error: ApiError) => void
): Record<string, any> | undefined | null {
const promiseKey = GrowStatePromiseKeys.GetStrings;
if (this.promises[promiseKey]) {
if (promiseKey in this.promises) {
return this.strings;
}
this.promises[promiseKey] = this.api.projectTypes.grow
Expand Down
14 changes: 8 additions & 6 deletions src/ts/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import StackdriverErrorReporter from 'stackdriver-errors-js';
const stackdriverKey = document.body.dataset.stackdriverKey;
if (stackdriverKey) {
const projectId = document.body.dataset.projectId;
const errorHandler = new StackdriverErrorReporter();
errorHandler.start({
projectId: projectId,
key: stackdriverKey,
service: 'editor.dev',
});
if (projectId) {
const errorHandler = new StackdriverErrorReporter();
errorHandler.start({
projectId: projectId,
key: stackdriverKey,
service: 'editor.dev',
});
}
}

const container = document.querySelector('.container') as HTMLElement;
Expand Down
5 changes: 0 additions & 5 deletions src/ts/server/stackdriver-errors-js.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"module": "commonjs",
"moduleResolution": "node",
"outDir": "dist",
"resolveJsonModule": true,
"rootDir": "src/ts/",
"target": "es2020",
},
Expand Down

0 comments on commit eafe215

Please sign in to comment.