Skip to content

Commit

Permalink
fix all webpack errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
greysonn committed Aug 2, 2019
1 parent ff1a65c commit e35a7cf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/common/custom.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*.svg' {
const content: any;
export default content;
}
8 changes: 4 additions & 4 deletions src/main/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Entry point of the Election app.
*/
import { app, BrowserWindow, ipcMain, Event } from 'electron';
import { app, BrowserWindow, Event, ipcMain } from 'electron';
import * as os from 'os';
import * as path from 'path';
import * as url from 'url';
Expand Down Expand Up @@ -44,7 +44,7 @@ function createWindow(): void {
}

mainWindow.webContents.on('did-finish-load', (): void => {
mainWindow.webContents.send('getSales', data.getSales());
mainWindow!.webContents.send('getSales', data.getSales());
});

mainWindow.on('closed', () => {
Expand All @@ -54,14 +54,14 @@ function createWindow(): void {

ipcMain.on('createSale', async (event: Event, arg: { sale: SaleInfo }) => {
await data.createSale(arg.sale);
mainWindow.webContents.send('getSales', data.getSales());
mainWindow!.webContents.send('getSales', data.getSales());
});

ipcMain.on('deleteSale', async (event: Event, sale: SaleInfo) => {
const sales: SaleInfo[] = data.getSales();
const index: number = sales.indexOf(sale);
await data.deleteSale(index);
mainWindow.webContents.send('getSales', data.getSales());
mainWindow!.webContents.send('getSales', data.getSales());
});

app.on('ready', createWindow);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/addSale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class AddSale extends React.Component<AddSaleProps, AddSaleState> {

private addProduct(event: any): void {
// tslint:disable: no-for-in
const state: AddSaleState = this.state;
const state: any = this.state;
for (const value in state) {
if (state[value] === '') {
toast.error('Form is incomplete');
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import * as React from 'react';
import { Link } from 'react-router-dom';

import SettingsIcon from '@public/img/settings.svg';
import HomeIcon from '@public/img/home.svg';
import SettingsIcon from '@public/img/settings.svg';
import '@public/scss/navbar.scss';

type NavbarProps = {};
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/routes/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class Settings extends React.Component<SettingProps, SettingState> {
);
}

private showToast() {
private showToast(): void {
toast.error('Stockx/Goat connections may be coming soon.');
}
}
1 change: 1 addition & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ignore-case": true
}
],
"no-non-null-assertion": false,
"no-any": false,
"no-unsafe-any": false,
"import-name": false,
Expand Down

0 comments on commit e35a7cf

Please sign in to comment.