diff options
| author | okayurisotto <okayurisotto@proton.me> | 2023-07-14 10:45:01 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-14 10:45:01 +0900 |
| commit | 2b6dbd4fcbec380d65b0c318932d9eeb3fcb3f7b (patch) | |
| tree | 125b6f724450c37bd1c025d5b3e09c50dc2b20c9 /packages/backend/src/queue/processors/DeleteAccountProcessorService.ts | |
| parent | refactor: `substr` -> `substring` (#11273) (diff) | |
| download | sharkey-2b6dbd4fcbec380d65b0c318932d9eeb3fcb3f7b.tar.gz sharkey-2b6dbd4fcbec380d65b0c318932d9eeb3fcb3f7b.tar.bz2 sharkey-2b6dbd4fcbec380d65b0c318932d9eeb3fcb3f7b.zip | |
refactor: 可読性のため一部で`Array.prototype.at`を使うように (#11274)
* refactor: `Array.prototype.at`を使うように
* fixup! refactor: `Array.prototype.at`を使うように
Diffstat (limited to 'packages/backend/src/queue/processors/DeleteAccountProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/DeleteAccountProcessorService.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts index 65ded170b7..b2886563f4 100644 --- a/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts +++ b/packages/backend/src/queue/processors/DeleteAccountProcessorService.ts @@ -70,7 +70,7 @@ export class DeleteAccountProcessorService { break; } - cursor = notes[notes.length - 1].id; + cursor = notes.at(-1)?.id ?? null; await this.notesRepository.delete(notes.map(note => note.id)); @@ -101,7 +101,7 @@ export class DeleteAccountProcessorService { break; } - cursor = files[files.length - 1].id; + cursor = files.at(-1)?.id ?? null; for (const file of files) { await this.driveService.deleteFileSync(file); |