fix some eslint errors
This commit is contained in:
parent
14410ce903
commit
1161392d3b
|
@ -439,7 +439,6 @@ export function fetchChunk(canvasId, center: Cell): PromiseAction {
|
|||
dispatch(receiveBigChunkFailure(center, error));
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(`Error at requesting chunk ${cx}/${cy}`);
|
||||
dispatch(receiveBigChunkFailure(center, error));
|
||||
}
|
||||
};
|
||||
|
@ -558,7 +557,7 @@ export function fetchStats(): PromiseAction {
|
|||
}
|
||||
|
||||
export function fetchMe(): PromiseAction {
|
||||
return async (dispatch, getState) => {
|
||||
return async (dispatch) => {
|
||||
const response = await fetch('/api/me', {
|
||||
credentials: 'include',
|
||||
});
|
||||
|
@ -666,13 +665,13 @@ export function onViewFinishChange(): Action {
|
|||
}
|
||||
|
||||
export function urlChange(): PromiseAction {
|
||||
return (dispatch, getState) => {
|
||||
return (dispatch) => {
|
||||
dispatch(reloadUrl());
|
||||
};
|
||||
}
|
||||
|
||||
export function switchCanvas(canvasId: number): PromiseAction {
|
||||
return async (dispatch, getState) => {
|
||||
return async (dispatch) => {
|
||||
await dispatch(selectCanvas(canvasId));
|
||||
dispatch(onViewFinishChange());
|
||||
};
|
||||
|
|
|
@ -19,7 +19,7 @@ export function getHtml(description, text, host) {
|
|||
const data = {
|
||||
title: 'PixelPlanet.fun Accounts',
|
||||
description,
|
||||
body: <RedirectionPage text={text} host ={host} />,
|
||||
body: <RedirectionPage text={text} host={host} />,
|
||||
code: `window.setTimeout(function(){window.location.href="${host}";},4000)`,
|
||||
};
|
||||
const index = `<!doctype html>${ReactDOM.renderToStaticMarkup(<Html {...data} />)}`;
|
||||
|
|
|
@ -105,7 +105,7 @@ async function oauth_login(email, name, discordid = null) {
|
|||
*/
|
||||
passport.use(new FacebookStrategy({
|
||||
...auth.facebook,
|
||||
callbackURL: `/api/auth/facebook/return`,
|
||||
callbackURL: '/api/auth/facebook/return',
|
||||
proxy: true,
|
||||
profileFields: ['displayName', 'email'],
|
||||
}, async (req, accessToken, refreshToken, profile, done) => {
|
||||
|
@ -120,7 +120,7 @@ passport.use(new FacebookStrategy({
|
|||
*/
|
||||
passport.use(new DiscordStrategy({
|
||||
...auth.discord,
|
||||
callbackURL: `/api/auth/discord/return`,
|
||||
callbackURL: '/api/auth/discord/return',
|
||||
proxy: true,
|
||||
}, async (accessToken, refreshToken, profile, done) => {
|
||||
// TODO get discord id
|
||||
|
@ -135,7 +135,7 @@ passport.use(new DiscordStrategy({
|
|||
*/
|
||||
passport.use(new GoogleStrategy({
|
||||
...auth.google,
|
||||
callbackURL: `/api/auth/google/return`,
|
||||
callbackURL: '/api/auth/google/return',
|
||||
proxy: true,
|
||||
}, async (accessToken, refreshToken, profile, done) => {
|
||||
const { displayName: name, emails } = profile;
|
||||
|
@ -149,7 +149,7 @@ passport.use(new GoogleStrategy({
|
|||
*/
|
||||
passport.use(new RedditStrategy({
|
||||
...auth.reddit,
|
||||
callbackURL: `/api/auth/reddit/return`,
|
||||
callbackURL: '/api/auth/reddit/return',
|
||||
proxy: true,
|
||||
}, async (accessToken, refreshToken, profile, done) => {
|
||||
console.log({ profile, refreshToken, accessToken });
|
||||
|
@ -181,7 +181,7 @@ passport.use(new RedditStrategy({
|
|||
*/
|
||||
passport.use(new VkontakteStrategy({
|
||||
...auth.vk,
|
||||
callbackURL: `/api/auth/vk/return`,
|
||||
callbackURL: '/api/auth/vk/return',
|
||||
proxy: true,
|
||||
scope: ['email'],
|
||||
profileFields: ['displayName', 'email'],
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* timers and cron for account related actions
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import Sequelize from 'sequelize';
|
||||
|
@ -7,7 +8,7 @@ import Model from '../data/sequelize';
|
|||
import RegUser from '../data/models/RegUser';
|
||||
import logger from './logger';
|
||||
|
||||
import { HOUR, MINUTE } from './constants';
|
||||
import { MINUTE } from './constants';
|
||||
import { DailyCron } from '../utils/cron';
|
||||
|
||||
class Ranks {
|
||||
|
@ -53,5 +54,5 @@ class Ranks {
|
|||
}
|
||||
|
||||
|
||||
export const rankings = new Ranks();
|
||||
const rankings = new Ranks();
|
||||
export default rankings;
|
||||
|
|
|
@ -90,8 +90,10 @@ class ChunkRGB {
|
|||
|
||||
empty() {
|
||||
this.ready = true;
|
||||
const ctx = this.image.getContext('2d');
|
||||
ctx.fillStyle = this.palette.colors[0];
|
||||
const { image, palette } = this;
|
||||
const ctx = image.getContext('2d');
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
ctx.fillStyle = palette.colors[0];
|
||||
ctx.fillRect(0, 0, TILE_SIZE, TILE_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ function isTrustedProxy(ip: string): boolean {
|
|||
|
||||
export function getHostFromRequest(req): ?string {
|
||||
const { headers } = req;
|
||||
const host = headers['x-forwarded-host'] || headers['host'];
|
||||
const host = headers['x-forwarded-host'] || headers.host;
|
||||
const proto = headers['x-forwarded-proto'] || 'http';
|
||||
|
||||
return `${proto}://${host}`;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
* @flow
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-useless-escape, max-len
|
||||
const mailTester = /^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;
|
||||
|
||||
export function validateEMail(email) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user