From 21dc7aebe7b4d8e4a5c6c1542e0ee7d2d64ffacf Mon Sep 17 00:00:00 2001 From: Yuri Lee Date: Wed, 19 Mar 2025 19:23:50 +0900 Subject: [PATCH] Fix: Don't delete remote emoji when import zip (#15674) * Fix: Don't delete remote emoji when import zip * Update packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> --------- Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com> --- .../src/queue/processors/ImportCustomEmojisProcessorService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts b/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts index 725e1c8ba2..95fe0a2c6a 100644 --- a/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportCustomEmojisProcessorService.ts @@ -6,6 +6,7 @@ import * as fs from 'node:fs'; import { Inject, Injectable } from '@nestjs/common'; import { ZipReader } from 'slacc'; +import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; import type { EmojisRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; @@ -86,6 +87,7 @@ export class ImportCustomEmojisProcessorService { const emojiPath = outputPath + '/' + record.fileName; await this.emojisRepository.delete({ name: emojiInfo.name, + host: IsNull(), }); try {