Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing version and image in "About" #506

Merged
merged 6 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/main/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from "path";
import {existsSync, createWriteStream} from "fs";
import {mainLogger} from "../logger";
import archiver from "archiver";
import logo from "../../../assets/logo.png"

const reloadDialog = (window: BrowserWindow): number =>
dialog.showMessageBoxSync(window, {
Expand Down Expand Up @@ -36,9 +37,7 @@ const template = [
{
label: "About",
click: (event: KeyboardEvent, window: BrowserWindow): void => {
const iconPath = nativeImage.createFromPath(
path.join(__dirname, `../src/renderer/assets/ico/app_icon.png`),
);
const iconPath = nativeImage.createFromPath(path.join(process.mainModule.path, logo));
dialog.showMessageBox(window, {
type: "none",
message: "Chain Guardian",
Expand Down
1 change: 1 addition & 0 deletions webpack.base.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const plugins = [
"process.env.SENTRY_ORG": JSON.stringify(process.env.SENTRY_ORG || "nodefactory"),
"process.env.SENTRY_PROJECT": JSON.stringify(process.env.SENTRY_PROJECT || "chainguardian"),
"process.env.SENTRY_AUTH_TOKEN": JSON.stringify(process.env.SENTRY_AUTH_TOKEN || ""),
"process.env.npm_package_version": JSON.stringify(packageJson.version),
}),
];

Expand Down
15 changes: 14 additions & 1 deletion webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,20 @@ module.exports = merge.smart(baseConfig, {
["@babel/plugin-proposal-class-properties", {loose: true}]
]
}
}
},
{
// used for menu "about"
test: /\.(png)$/,
use: [
"file-loader",
{
loader: "image-webpack-loader",
options: {
disable: true
}
}
]
},
]
},
plugins: [
Expand Down
18 changes: 18 additions & 0 deletions webpack.main.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,23 @@ const baseConfig = require("./webpack.main.config");
const baseProdConfig = require("./webpack.base.prod.config");

module.exports = merge.smart(baseConfig, baseProdConfig, {
module: {
rules: [
{
// used for menu "about"
test: /\.(png)$/,
use: [
"file-loader",
{
loader: "image-webpack-loader",
options: {
disable: true
}
}
]
},
],
},
}, {
mode: "production",
});