Skip to content

Commit

Permalink
[MOD] Missing icons
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarrc committed Jul 26, 2024
1 parent c2dce5b commit 1c0adba
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 49 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/oscarrc/nts-web",
"type": "git"
},
"main": "public/electron.js",
"main": "public/electron.cjs",
"homepage": "./",
"private": true,
"scripts": {
Expand All @@ -36,7 +36,7 @@
"artifactName": "NTS-web_${os}-${arch}-${version}.${ext}",
"files": [
"build/**/*",
"public/electron.js",
"public/electron.cjs",
"node_modules/**/*"
],
"directories": {
Expand Down
94 changes: 47 additions & 47 deletions public/electron.js → public/electron.cjs
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
const { app, BrowserWindow, protocol, screen } = require("electron");
const path = require("path");
const url = require("url");

const createWindow = () => {
const {width, height} = screen.getPrimaryDisplay().workAreaSize;

const win = new BrowserWindow({
width,
height,
webPreferences: {
nodeIntegration: true
}
});

const appUrl = !app.isPackaged ? "http://localhost:3000" : url.format({ pathname: path.join(__dirname, "index.html"), protocol: "file:", slashes: true })

win.maximize();
win.setMenuBarVisibility(false);
win.loadURL(appUrl);

if (!app.isPackaged ) win.webContents.openDevTools({ mode: "detach" });
}

const setupLocalFilesNormalizerProxy = () => {
protocol.registerHttpProtocol("file", (request, callback) => {
if(!request.url) console.error("Failed to register protocol");
else {
const url = request.url.substr(8);
callback({ path: path.normalize(`${__dirname}/${url}`) });
}
});
}

app.whenReady().then(() => {
createWindow();
setupLocalFilesNormalizerProxy();
});

app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});

app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
const { app, BrowserWindow, protocol, screen } = require("electron");
const path = require("path");
const url = require("url");

const createWindow = () => {
const {width, height} = screen.getPrimaryDisplay().workAreaSize;

const win = new BrowserWindow({
width,
height,
webPreferences: {
nodeIntegration: true
}
});

const appUrl = !app.isPackaged ? "http://localhost:3000" : url.format({ pathname: path.join(__dirname, "index.html"), protocol: "file:", slashes: true })

win.maximize();
win.setMenuBarVisibility(false);
win.loadURL(appUrl);

if (!app.isPackaged ) win.webContents.openDevTools({ mode: "detach" });
}

const setupLocalFilesNormalizerProxy = () => {
protocol.registerHttpProtocol("file", (request, callback) => {
if(!request.url) console.error("Failed to register protocol");
else {
const url = request.url.substr(8);
callback({ path: path.normalize(`${__dirname}/${url}`) });
}
});
}

app.whenReady().then(() => {
createWindow();
setupLocalFilesNormalizerProxy();
});

app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});

app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
app.quit();
}
});
Binary file removed public/static/media/explainer.mp4
Binary file not shown.
Binary file added public/static/media/feature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/static/media/icons/icon.icns
Binary file not shown.
Binary file added public/static/media/icons/icon.ico
Binary file not shown.

0 comments on commit 1c0adba

Please sign in to comment.