Skip to content

Commit 5c0bbe6

Browse files
Fix positioner related problems
1 parent a18a724 commit 5c0bbe6

File tree

6 files changed

+11
-72
lines changed

6 files changed

+11
-72
lines changed

.erb/configs/webpack.config.renderer.dev.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const configuration: webpack.Configuration = {
168168
shell: true,
169169
stdio: 'inherit',
170170
})
171-
.on('close', (code: number) => process.exit(code!))
171+
.on('close', (code: number) => process.exit(code))
172172
.on('error', (spawnError) => console.error(spawnError));
173173

174174
console.log('Starting Main Process...');
@@ -178,7 +178,7 @@ const configuration: webpack.Configuration = {
178178
})
179179
.on('close', (code: number) => {
180180
preloadProcess.kill();
181-
process.exit(code!);
181+
process.exit(code);
182182
})
183183
.on('error', (spawnError) => console.error(spawnError));
184184
return middlewares;

package-lock.json

-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
"@teamsupercell/typings-for-css-modules-loader": "^2.5.1",
107107
"@testing-library/jest-dom": "^5.16.4",
108108
"@testing-library/react": "^13.2.0",
109-
"@types/electron-positioner": "^4.1.1",
110109
"@types/jest": "^27.5.1",
111110
"@types/node": "17.0.33",
112111
"@types/react": "^18.0.9",

src/main/main.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import path from 'path';
1212
import { app, BrowserWindow, shell, ipcMain } from 'electron';
1313
import { autoUpdater } from 'electron-updater';
1414
import log from 'electron-log';
15-
import Positoner from 'electron-positioner';
1615
import { ElectronBlocker } from '@cliqz/adblocker-electron';
1716
import fetch from 'cross-fetch';
1817
import { resolveHtmlPath } from './util';
1918
import MenuBuilder from './menu';
2019

21-
let positioner: Positoner;
20+
const Positoner = require('electron-positioner');
21+
22+
let positioner: any;
2223

2324
export default class AppUpdater {
2425
constructor() {
@@ -159,6 +160,6 @@ app
159160
})
160161
.catch(console.log);
161162

162-
ipcMain.on('window-move', (event, args) => {
163+
ipcMain.on('window-move', (_event, args) => {
163164
positioner.move(args);
164165
});

src/renderer/components/Settings/SearchEngineModal.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { SearchContext } from '../../context/SearchContext';
1313

1414
type SearchEngineModalProps = {
1515
isOpen: boolean;
16-
onClose: any;
16+
onClose: () => void;
1717
};
1818

1919
const SearchEngineModal = ({ isOpen, onClose }: SearchEngineModalProps) => {

src/renderer/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ const theme = extendTheme({
2626
},
2727
});
2828

29-
const container = document.getElementById('root')!;
30-
const root = createRoot(container);
31-
root.render(
29+
const container = document.getElementById('root');
30+
const root = container && createRoot(container);
31+
32+
root?.render(
3233
<ChakraProvider resetCSS theme={theme}>
3334
<App />
3435
</ChakraProvider>

0 commit comments

Comments
 (0)