mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-12-22 18:18:55 +00:00
1. Fix (broken since 2016): Notifications broken by lambda constructor 2. Fix: `--processEnvs` broken by additional processEnvs object, the result was: `processEnvs: {processEnvs: {...}}` which caused the conversion of the inner object into string `[object Object]`, no nesting allowed there probably. Compatibility introduced. 3. Fix: package.json missing `prepare` (or even prepublish), which breaks using as git dependency.
This commit is contained in:
parent
9ccda87938
commit
1d3bed5f09
@ -24,10 +24,15 @@ const fileDownloadOptions = { ...appArgs.fileDownloadOptions };
|
||||
electronDownload(fileDownloadOptions);
|
||||
|
||||
if (appArgs.processEnvs) {
|
||||
Object.keys(appArgs.processEnvs).forEach((key) => {
|
||||
/* eslint-env node */
|
||||
process.env[key] = appArgs.processEnvs[key];
|
||||
});
|
||||
// This is compatibility if just a string was passed.
|
||||
if (typeof appArgs.processEnvs === 'string') {
|
||||
process.env.processEnvs = appArgs.processEnvs;
|
||||
} else {
|
||||
Object.keys(appArgs.processEnvs).forEach((key) => {
|
||||
/* eslint-env node */
|
||||
process.env[key] = appArgs.processEnvs[key];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let mainWindow;
|
||||
|
@ -22,7 +22,7 @@ const INJECT_JS_PATH = path.join(__dirname, '..', 'inject/inject.js');
|
||||
*/
|
||||
function setNotificationCallback(createCallback, clickCallback) {
|
||||
const OldNotify = window.Notification;
|
||||
const newNotify = (title, opt) => {
|
||||
const newNotify = function (title, opt) {
|
||||
createCallback(title, opt);
|
||||
const instance = new OldNotify(title, opt);
|
||||
instance.addEventListener('click', clickCallback);
|
||||
|
@ -42,6 +42,7 @@
|
||||
"lint:format": "prettier --write 'src/**/*.js' 'app/src/**/*.js'",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"list-outdated-deps": "npm out; cd app && npm out; true",
|
||||
"prepare": "cd ./app && npm install && cd .. && npm run build",
|
||||
"test:integration": "jest --testRegex '.*integration-test.js'",
|
||||
"test:manual": "npm run build && ./docs/manual-test",
|
||||
"test:unit": "jest",
|
||||
|
@ -52,7 +52,7 @@ function getProcessEnvs(val: string): any {
|
||||
if (!val) {
|
||||
return {};
|
||||
}
|
||||
return { processEnvs: parseJson(val) };
|
||||
return parseJson(val);
|
||||
}
|
||||
|
||||
function checkInternet(): void {
|
||||
|
Loading…
Reference in New Issue
Block a user