Update to Angular 9

This commit is contained in:
2026-03-22 08:43:45 +01:00
parent 3addbc1a4e
commit 3045419fe8
7 changed files with 7281 additions and 387 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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: [],
+4 -3
View File
@@ -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([
+3 -3
View File
@@ -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) {