update packages
remove push.js
This commit is contained in:
parent
520dc1655e
commit
ddc41802fe
14
package.json
14
package.json
|
@ -40,16 +40,14 @@
|
||||||
"express-session": "^1.15.2",
|
"express-session": "^1.15.2",
|
||||||
"global": "^4.3.2",
|
"global": "^4.3.2",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"http-proxy-agent": "^2.1.0",
|
"http-proxy-agent": "^3.0.0",
|
||||||
"ip": "^1.1.5",
|
"ip": "^1.1.5",
|
||||||
"ip-address": "^5.8.9",
|
"ip-address": "^6.2.0",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"keycode": "^2.1.9",
|
"keycode": "^2.1.9",
|
||||||
"localforage": "^1.5.0",
|
"localforage": "^1.5.0",
|
||||||
"lumber-cli": "^1.3.1",
|
|
||||||
"morgan": "^1.8.2",
|
"morgan": "^1.8.2",
|
||||||
"multer": "^1.4.1",
|
"multer": "^1.4.1",
|
||||||
"mysql2": "^1.3.6",
|
|
||||||
"node-sass": "^4.11.0",
|
"node-sass": "^4.11.0",
|
||||||
"passport": "^0.4.0",
|
"passport": "^0.4.0",
|
||||||
"passport-discord": "^0.1.2",
|
"passport-discord": "^0.1.2",
|
||||||
|
@ -58,7 +56,6 @@
|
||||||
"passport-json": "^1.2.0",
|
"passport-json": "^1.2.0",
|
||||||
"passport-reddit": "^0.2.4",
|
"passport-reddit": "^0.2.4",
|
||||||
"passport-vkontakte": "^0.3.2",
|
"passport-vkontakte": "^0.3.2",
|
||||||
"push.js": "1.0.9",
|
|
||||||
"react": "^16.9.0",
|
"react": "^16.9.0",
|
||||||
"react-dom": "^16.9.0",
|
"react-dom": "^16.9.0",
|
||||||
"react-file-download": "^0.3.4",
|
"react-file-download": "^0.3.4",
|
||||||
|
@ -82,8 +79,7 @@
|
||||||
"three": "^0.112.1",
|
"three": "^0.112.1",
|
||||||
"three-trackballcontrols-ts": "^0.1.2",
|
"three-trackballcontrols-ts": "^0.1.2",
|
||||||
"url-search-params-polyfill": "^7.0.0",
|
"url-search-params-polyfill": "^7.0.0",
|
||||||
"visibilityjs": "^1.2.4",
|
"winston": "^3.2.1",
|
||||||
"winston": "^2.3.1",
|
|
||||||
"ws": "^7.1.2"
|
"ws": "^7.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -125,13 +121,13 @@
|
||||||
"eslint-plugin-import": "^2.2.0",
|
"eslint-plugin-import": "^2.2.0",
|
||||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||||
"eslint-plugin-react": "^7.0.1",
|
"eslint-plugin-react": "^7.0.1",
|
||||||
"flow-bin": "^0.59.0",
|
"flow-bin": "^0.115.0",
|
||||||
"http-proxy": "^1.16.2",
|
"http-proxy": "^1.16.2",
|
||||||
"json-loader": "^0.5.4",
|
"json-loader": "^0.5.4",
|
||||||
"npm-check": "^5.9.0",
|
"npm-check": "^5.9.0",
|
||||||
"react-hot-loader": "^4.12.14",
|
"react-hot-loader": "^4.12.14",
|
||||||
"react-svg-loader": "^3.0.3",
|
"react-svg-loader": "^3.0.3",
|
||||||
"rimraf": "^2.6.1",
|
"rimraf": "^3.0.0",
|
||||||
"sass-loader": "^8.0.0",
|
"sass-loader": "^8.0.0",
|
||||||
"style-loader": "^1.1.2",
|
"style-loader": "^1.1.2",
|
||||||
"webpack": "^4.41.0",
|
"webpack": "^4.41.0",
|
||||||
|
|
|
@ -10,7 +10,7 @@ import winston from 'winston';
|
||||||
|
|
||||||
const logger = winston;
|
const logger = winston;
|
||||||
|
|
||||||
export const proxyLogger = new winston.Logger({
|
export const proxyLogger = winston.createLogger({
|
||||||
transports: [
|
transports: [
|
||||||
new winston.transports.File({
|
new winston.transports.File({
|
||||||
level: 'info',
|
level: 'info',
|
||||||
|
|
|
@ -4,47 +4,38 @@
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Push from 'push.js';
|
|
||||||
|
|
||||||
function onGranted() {
|
|
||||||
|
|
||||||
}
|
|
||||||
function onDenied() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export default (store) => (next) => (action) => {
|
export default (store) => (next) => (action) => {
|
||||||
if (!Push.isSupported) return next(action);
|
try {
|
||||||
|
switch (action.type) {
|
||||||
|
case 'PLACE_PIXEL': {
|
||||||
|
if (window.Notification
|
||||||
|
&& Notification.permission !== 'granted'
|
||||||
|
&& Notification.permission !== 'denied'
|
||||||
|
) {
|
||||||
|
Notification.requestPermission();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (action.type) {
|
case 'COOLDOWN_END': {
|
||||||
case 'PLACE_PIXEL': {
|
if (window.Notification && Notification.permission === 'granted') {
|
||||||
// request permission
|
// eslint-disable-next-line no-unused-vars
|
||||||
// gives callback error now
|
const notification = new Notification('Your next pixels are ready', {
|
||||||
Push.Permission.request(onGranted, onDenied);
|
icon: '/tile.png',
|
||||||
|
silent: true,
|
||||||
|
vibrate: [200, 100],
|
||||||
|
body: 'You can now place more on pixelplanet.fun :)',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// clear notifications
|
default:
|
||||||
Push.clear();
|
// nothing
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
case 'COOLDOWN_END': {
|
console.error(e);
|
||||||
Push.create('Your next pixel is now available', {
|
|
||||||
icon: '/tile.png',
|
|
||||||
silent: true,
|
|
||||||
vibrate: [200, 100],
|
|
||||||
onClick() {
|
|
||||||
parent.focus();
|
|
||||||
window.focus();
|
|
||||||
Push.clear();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
// nothing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return next(action);
|
return next(action);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user