Skip to content

Commit

Permalink
fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebarkmin committed Jan 20, 2023
1 parent 9e805fd commit efcbd6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
9 changes: 1 addition & 8 deletions platforms/desktop/forge.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { ForgeConfig } from "@electron-forge/shared-types";
import { MakerSquirrel } from "@electron-forge/maker-squirrel";
import { MakerZIP } from "@electron-forge/maker-zip";
import { MakerDeb } from "@electron-forge/maker-deb";
import { MakerRpm } from "@electron-forge/maker-rpm";
import { WebpackPlugin } from "@electron-forge/plugin-webpack";

import { mainConfig } from "./webpack.main.config";
Expand All @@ -21,12 +19,7 @@ const config: ForgeConfig = {
},
},
rebuildConfig: {},
makers: [
new MakerSquirrel({}),
new MakerZIP({}, ["darwin"]),
new MakerRpm({}),
new MakerDeb({}),
],
makers: [new MakerSquirrel({}), new MakerZIP({}, ["darwin", "linux"])],
plugins: [
new WebpackPlugin({
mainConfig,
Expand Down
2 changes: 1 addition & 1 deletion platforms/desktop/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const App = () => {
}, []);

if (!state) {
return "...";
return <div>...</div>;
}

return (
Expand Down
8 changes: 5 additions & 3 deletions platforms/desktop/src/fileManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ export class FileManager {
this.emitFileChangedEvent();
}
async onAdd() {
this._vfiles = await vfile.list(this._activeRoot);
this.emitFileChangedEvent();
if (this._activeRoot) {
this._vfiles = await vfile.list(this._activeRoot);
this.emitFileChangedEvent();
}
}

async emitConfigChangedEvent() {
Expand All @@ -99,7 +101,7 @@ export class FileManager {
}
}
async emitFileChangedEvent() {
if (this._vfile) {
if (this._vfile && this._activeRoot) {
const { content, data } = await vfile.getMarkdown(this._vfile);
const navigation = await hyperbook.getNavigation(
this._activeRoot,
Expand Down
4 changes: 1 addition & 3 deletions platforms/desktop/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ const createWindow = (): void => {
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
nodeIntegration: true,
contextIsolation: false,
devTools: !app.isPackaged,
},
});

// and load the index.html of the app.
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY);

// Open the DevTools.
mainWindow.webContents.openDevTools();

const hyperbookRoot =
"/var/home/mbarkmin/Sources/openpatch/hyperbook/main/website";
new FileManager(hyperbookRoot, mainWindow);
Expand Down

0 comments on commit efcbd6a

Please sign in to comment.