mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Update to Angular 9
This commit is contained in:
@@ -24,7 +24,7 @@ function loadSpriteSheet(sheet: SpriteSheet, loadImage: LoadImage) {
|
||||
sheet.srcA ? loadImage(sheet.srcA) : Promise.resolve(undefined)
|
||||
])
|
||||
.then(([img, imgA]) => {
|
||||
sheet.data = getImageData(img);
|
||||
sheet.data = getImageData(img!);
|
||||
|
||||
if (imgA) {
|
||||
const alpha = getImageData(imgA);
|
||||
|
||||
@@ -12,7 +12,7 @@ export function getWebGLContext(canvas: HTMLCanvasElement): WebGLRenderingContex
|
||||
|
||||
let gl = canvas.getContext('webgl2', options)
|
||||
|| canvas.getContext('webgl', options)
|
||||
|| canvas.getContext('experimental-webgl', options);
|
||||
|| canvas.getContext('experimental-webgl', options) as WebGLRenderingContext;
|
||||
|
||||
if (!gl) {
|
||||
throw new Error(WEBGL_CREATION_ERROR);
|
||||
|
||||
@@ -238,8 +238,8 @@ export async function getAccountDetails(accountId: ID): Promise<AccountDetails>
|
||||
merges: account.merges || [],
|
||||
banLog: account.banLog || [],
|
||||
supporterLog: account.supporterLog || [],
|
||||
invitesReceived: invitesReceived.map(convertInvite),
|
||||
invitesSent: invitesSent.map(convertInvite),
|
||||
invitesReceived: invitesReceived!.map(convertInvite),
|
||||
invitesSent: invitesSent!.map(convertInvite),
|
||||
state: account.state || {},
|
||||
} : {
|
||||
merges: [],
|
||||
|
||||
@@ -119,11 +119,12 @@ async function merge(
|
||||
const merges = mergeLists(account.merges, merge.merges, 20);
|
||||
const state = mergeStates(account.state, merge.state);
|
||||
const alert = account.alert || merge.alert;
|
||||
merges.push({ id: withId, name: merge.name, date: new Date(), reason, data });
|
||||
merges.push({ id: withId, name: merge.name, date: new Date(), reason, data } as any);
|
||||
|
||||
const update: Partial<AccountBase<string>> = {
|
||||
origins, ignores, emails, note, lastVisit, ban, shadow, mute, flags, counters, patreon, supporter, merges,
|
||||
createdAt, supporterLog, supporterTotal, banLog, state, alert, birthdate,
|
||||
origins, ignores, emails, note, lastVisit, ban, shadow, mute, flags,
|
||||
counters, patreon, supporter, merges: merges as any, createdAt, supporterLog: supporterLog as any,
|
||||
supporterTotal, banLog: banLog as any, state, alert, birthdate,
|
||||
};
|
||||
|
||||
await Promise.all([
|
||||
|
||||
@@ -2,7 +2,7 @@ import { uniq } from 'lodash';
|
||||
import { Types } from 'mongoose';
|
||||
import { Profile } from '../common/interfaces';
|
||||
import { arraysEqual } from '../common/utils';
|
||||
import { IAccount, IAuth, Auth, findAuthByOpenId, updateAuth, UpdateAuth, Account } from './db';
|
||||
import { IAccount, IAuth, Auth, findAuthByOpenId, updateAuth, UpdateAuth, Account, MongoUpdate } from './db';
|
||||
import { system } from './logger';
|
||||
import { UserError } from './userError';
|
||||
import { CreateAccountOptions, connectOnlySocialError } from './accountUtils';
|
||||
@@ -48,7 +48,7 @@ export async function updateAuthInfo(
|
||||
if (!auth)
|
||||
return;
|
||||
|
||||
const changes: Partial<IAuth> = {};
|
||||
const changes: MongoUpdate<IAuth> = {};
|
||||
|
||||
if (profile.url && auth.url !== profile.url) {
|
||||
changes.url = profile.url;
|
||||
@@ -91,7 +91,7 @@ async function createAuth(profile: Profile, account: string | undefined) {
|
||||
}
|
||||
|
||||
async function verifyOrRestoreAuth(auth: IAuth, mergeAccount: string | undefined) {
|
||||
const changes: Partial<IAuth> = { lastUsed: new Date() };
|
||||
const changes: MongoUpdate<IAuth> = { lastUsed: new Date() };
|
||||
|
||||
if (auth.disabled || auth.banned) {
|
||||
if (!auth.banned && auth.account && !!mergeAccount) {
|
||||
|
||||
Reference in New Issue
Block a user