Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(main): change loading of html file to load a base64 encoded html (#…
Browse files Browse the repository at this point in the history
…482)

creation of a html file inside a ASAR package is not possible. Because of this we are just loading the base html as a base64 encoded url
  • Loading branch information
lkuechler authored and marionebl committed May 30, 2018
1 parent bad763d commit e2c5772
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Persistence, PersistenceState } from '../persistence';
import * as Sender from '../message/server';
import { createServer } from './server';
import * as Types from '../model/types';
import * as Url from 'url';
import * as Util from 'util';
import * as uuid from 'uuid';

Expand All @@ -35,8 +34,6 @@ const RENDERER_DOCUMENT = `<!doctype html>
</body>
</html>`;

Fs.writeFileSync(Path.join(__dirname, 'app.html'), RENDERER_DOCUMENT);

const showOpenDialog = (options: Electron.OpenDialogOptions): Promise<string[]> =>
new Promise(resolve => dialog.showOpenDialog(options, resolve));

Expand Down Expand Up @@ -71,13 +68,7 @@ async function createWindow(): Promise<void> {
});

// and load the index.html of the app.
win.loadURL(
Url.format({
pathname: Path.join(__dirname, 'app.html'),
protocol: 'file:',
slashes: true
})
);
win.loadURL('data:text/html;charset=utf-8,' + encodeURI(RENDERER_DOCUMENT));

// Cast getPort return type from PromiseLike<number> to Promise<number>
// to avoid async-promise tslint rule to produce errors here
Expand Down

0 comments on commit e2c5772

Please sign in to comment.