Not crashing when not supplying push-data thingies

This commit is contained in:
Kasper Rynning-Tønnesen
2020-03-02 13:33:44 +01:00
parent 45c994d473
commit 6589425e54
6 changed files with 28 additions and 8 deletions
+8
View File
@@ -0,0 +1,8 @@
try {
module.exports = require("./push.config");
} catch (e) {
console.error(
"You haven't defined push-parameters, you sure you want to continue without them?"
);
module.exports = { publicKey: false, privateKey: false, mailto: false };
}
+1 -1
View File
@@ -42,7 +42,7 @@ const ServiceWorkerConfig = {
plugins: [
new webpack.DefinePlugin({
__DATE__: new Date().getTime(),
__PUBLICKEY__: JSON.stringify(require("./env/push.config").publicKey)
__PUBLICKEY__: JSON.stringify(require("./env/push").publicKey)
})
]
};
+2 -1
View File
@@ -78,7 +78,8 @@ const webpackConfig = function(isDev) {
__PRICE__: env.price,
__MESSAGE__: JSON.stringify(env.message),
__DATE__: env.date,
__HOURS__: env.hours
__HOURS__: env.hours,
__PUSHENABLED__: JSON.stringify(require("./env/push") != false)
})
]
};