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));
|
dispatch(receiveBigChunkFailure(center, error));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`Error at requesting chunk ${cx}/${cy}`);
|
|
||||||
dispatch(receiveBigChunkFailure(center, error));
|
dispatch(receiveBigChunkFailure(center, error));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -558,7 +557,7 @@ export function fetchStats(): PromiseAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function fetchMe(): PromiseAction {
|
export function fetchMe(): PromiseAction {
|
||||||
return async (dispatch, getState) => {
|
return async (dispatch) => {
|
||||||
const response = await fetch('/api/me', {
|
const response = await fetch('/api/me', {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
});
|
});
|
||||||
|
@ -666,13 +665,13 @@ export function onViewFinishChange(): Action {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function urlChange(): PromiseAction {
|
export function urlChange(): PromiseAction {
|
||||||
return (dispatch, getState) => {
|
return (dispatch) => {
|
||||||
dispatch(reloadUrl());
|
dispatch(reloadUrl());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function switchCanvas(canvasId: number): PromiseAction {
|
export function switchCanvas(canvasId: number): PromiseAction {
|
||||||
return async (dispatch, getState) => {
|
return async (dispatch) => {
|
||||||
await dispatch(selectCanvas(canvasId));
|
await dispatch(selectCanvas(canvasId));
|
||||||
dispatch(onViewFinishChange());
|
dispatch(onViewFinishChange());
|
||||||
};
|
};
|
||||||
|
|
|
@ -105,7 +105,7 @@ async function oauth_login(email, name, discordid = null) {
|
||||||
*/
|
*/
|
||||||
passport.use(new FacebookStrategy({
|
passport.use(new FacebookStrategy({
|
||||||
...auth.facebook,
|
...auth.facebook,
|
||||||
callbackURL: `/api/auth/facebook/return`,
|
callbackURL: '/api/auth/facebook/return',
|
||||||
proxy: true,
|
proxy: true,
|
||||||
profileFields: ['displayName', 'email'],
|
profileFields: ['displayName', 'email'],
|
||||||
}, async (req, accessToken, refreshToken, profile, done) => {
|
}, async (req, accessToken, refreshToken, profile, done) => {
|
||||||
|
@ -120,7 +120,7 @@ passport.use(new FacebookStrategy({
|
||||||
*/
|
*/
|
||||||
passport.use(new DiscordStrategy({
|
passport.use(new DiscordStrategy({
|
||||||
...auth.discord,
|
...auth.discord,
|
||||||
callbackURL: `/api/auth/discord/return`,
|
callbackURL: '/api/auth/discord/return',
|
||||||
proxy: true,
|
proxy: true,
|
||||||
}, async (accessToken, refreshToken, profile, done) => {
|
}, async (accessToken, refreshToken, profile, done) => {
|
||||||
// TODO get discord id
|
// TODO get discord id
|
||||||
|
@ -135,7 +135,7 @@ passport.use(new DiscordStrategy({
|
||||||
*/
|
*/
|
||||||
passport.use(new GoogleStrategy({
|
passport.use(new GoogleStrategy({
|
||||||
...auth.google,
|
...auth.google,
|
||||||
callbackURL: `/api/auth/google/return`,
|
callbackURL: '/api/auth/google/return',
|
||||||
proxy: true,
|
proxy: true,
|
||||||
}, async (accessToken, refreshToken, profile, done) => {
|
}, async (accessToken, refreshToken, profile, done) => {
|
||||||
const { displayName: name, emails } = profile;
|
const { displayName: name, emails } = profile;
|
||||||
|
@ -149,7 +149,7 @@ passport.use(new GoogleStrategy({
|
||||||
*/
|
*/
|
||||||
passport.use(new RedditStrategy({
|
passport.use(new RedditStrategy({
|
||||||
...auth.reddit,
|
...auth.reddit,
|
||||||
callbackURL: `/api/auth/reddit/return`,
|
callbackURL: '/api/auth/reddit/return',
|
||||||
proxy: true,
|
proxy: true,
|
||||||
}, async (accessToken, refreshToken, profile, done) => {
|
}, async (accessToken, refreshToken, profile, done) => {
|
||||||
console.log({ profile, refreshToken, accessToken });
|
console.log({ profile, refreshToken, accessToken });
|
||||||
|
@ -181,7 +181,7 @@ passport.use(new RedditStrategy({
|
||||||
*/
|
*/
|
||||||
passport.use(new VkontakteStrategy({
|
passport.use(new VkontakteStrategy({
|
||||||
...auth.vk,
|
...auth.vk,
|
||||||
callbackURL: `/api/auth/vk/return`,
|
callbackURL: '/api/auth/vk/return',
|
||||||
proxy: true,
|
proxy: true,
|
||||||
scope: ['email'],
|
scope: ['email'],
|
||||||
profileFields: ['displayName', 'email'],
|
profileFields: ['displayName', 'email'],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* timers and cron for account related actions
|
* timers and cron for account related actions
|
||||||
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Sequelize from 'sequelize';
|
import Sequelize from 'sequelize';
|
||||||
|
@ -7,7 +8,7 @@ import Model from '../data/sequelize';
|
||||||
import RegUser from '../data/models/RegUser';
|
import RegUser from '../data/models/RegUser';
|
||||||
import logger from './logger';
|
import logger from './logger';
|
||||||
|
|
||||||
import { HOUR, MINUTE } from './constants';
|
import { MINUTE } from './constants';
|
||||||
import { DailyCron } from '../utils/cron';
|
import { DailyCron } from '../utils/cron';
|
||||||
|
|
||||||
class Ranks {
|
class Ranks {
|
||||||
|
@ -53,5 +54,5 @@ class Ranks {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const rankings = new Ranks();
|
const rankings = new Ranks();
|
||||||
export default rankings;
|
export default rankings;
|
||||||
|
|
|
@ -90,8 +90,10 @@ class ChunkRGB {
|
||||||
|
|
||||||
empty() {
|
empty() {
|
||||||
this.ready = true;
|
this.ready = true;
|
||||||
const ctx = this.image.getContext('2d');
|
const { image, palette } = this;
|
||||||
ctx.fillStyle = this.palette.colors[0];
|
const ctx = image.getContext('2d');
|
||||||
|
// eslint-disable-next-line prefer-destructuring
|
||||||
|
ctx.fillStyle = palette.colors[0];
|
||||||
ctx.fillRect(0, 0, TILE_SIZE, TILE_SIZE);
|
ctx.fillRect(0, 0, TILE_SIZE, TILE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ function isTrustedProxy(ip: string): boolean {
|
||||||
|
|
||||||
export function getHostFromRequest(req): ?string {
|
export function getHostFromRequest(req): ?string {
|
||||||
const { headers } = req;
|
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';
|
const proto = headers['x-forwarded-proto'] || 'http';
|
||||||
|
|
||||||
return `${proto}://${host}`;
|
return `${proto}://${host}`;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* @flow
|
* @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])+$/;
|
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) {
|
export function validateEMail(email) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user