update backend to the new templates
This commit is contained in:
parent
4e30986cda
commit
05be2596ea
44 changed files with 156 additions and 111 deletions
|
|
@ -767,7 +767,7 @@ export class DriveService {
|
|||
|
||||
@bindThis
|
||||
public async deleteFileSync(file: MiDriveFile, isExpired = false, deleter?: { id: string }) {
|
||||
const promises = [];
|
||||
const promises: Promise<void>[] = [];
|
||||
|
||||
if (file.storedInternal) {
|
||||
promises.push(this.deleteLocalFile(file.accessKey!));
|
||||
|
|
|
|||
|
|
@ -299,7 +299,7 @@ export class MfmService {
|
|||
(note that the `rp` are to be ignored, they only exist
|
||||
for browsers who don't understand ruby)
|
||||
*/
|
||||
let nonRtNodes = [];
|
||||
let nonRtNodes: ChildNode[] = [];
|
||||
// scan children, ignore `rp`, split on `rt`
|
||||
for (const child of node.childNodes) {
|
||||
if (isText(child)) {
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ export class ReactionsBufferingService implements OnApplicationShutdown {
|
|||
// TODO: scanは重い可能性があるので、別途 bufferedNoteIds を直接Redis上に持っておいてもいいかもしれない
|
||||
@bindThis
|
||||
public async bake(): Promise<void> {
|
||||
const bufferedNoteIds = [];
|
||||
const bufferedNoteIds: string[] = [];
|
||||
let cursor = '0';
|
||||
do {
|
||||
// https://github.com/redis/ioredis#transparent-key-prefixing
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export class FlashEntityService {
|
|||
// { schema: 'UserDetailed' } すると無限ループするので注意
|
||||
const user = hint?.packedUser ?? await this.userEntityService.pack(flash.user ?? flash.userId, me);
|
||||
|
||||
let isLiked = undefined;
|
||||
let isLiked: boolean | undefined = undefined;
|
||||
if (meId) {
|
||||
isLiked = hint?.likedFlashIds
|
||||
? hint.likedFlashIds.includes(flash.id)
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ export class MetaEntityService {
|
|||
.getMany();
|
||||
|
||||
// クライアントの手間を減らすためあらかじめJSONに変換しておく
|
||||
let defaultLightTheme = null;
|
||||
let defaultDarkTheme = null;
|
||||
let defaultLightTheme: string | null = null;
|
||||
let defaultDarkTheme: string | null = null;
|
||||
if (instance.defaultLightTheme) {
|
||||
try {
|
||||
defaultLightTheme = JSON.stringify(JSON5.parse(instance.defaultLightTheme));
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ export class NoteEntityService implements OnModuleInit {
|
|||
|
||||
@bindThis
|
||||
public async packAttachedFiles(fileIds: MiNote['fileIds'], packedFiles: Map<MiNote['fileIds'][number], Packed<'DriveFile'> | null>): Promise<Packed<'DriveFile'>[]> {
|
||||
const missingIds = [];
|
||||
const missingIds: string[] = [];
|
||||
for (const id of fileIds) {
|
||||
if (!packedFiles.has(id)) missingIds.push(id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ export class NotificationEntityService implements OnModuleInit {
|
|||
|
||||
validNotifications = validNotifications.filter(x => !('noteId' in x) || packedNotes.has(x.noteId));
|
||||
|
||||
const userIds = [];
|
||||
const userIds: string[] = [];
|
||||
for (const notification of validNotifications) {
|
||||
if ('notifierId' in notification) userIds.push(notification.notifierId);
|
||||
if (notification.type === 'reaction:grouped') userIds.push(...notification.reactions.map(x => x.userId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue