From 688ad27d080e7a61bf9c93ee18129ae2ca74874e Mon Sep 17 00:00:00 2001 From: okayurisotto Date: Sun, 2 Jul 2023 13:58:40 +0900 Subject: [PATCH] cleanup(`ApNoteService.ts`) --- .../src/core/activitypub/models/ApNoteService.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 2c8d04e480..413eb52f3e 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -204,16 +204,8 @@ export class ApNoteService { if (!uri.match(/^https?:/)) return { status: 'permerror' }; try { const res = await this.resolveNote(uri); - if (res) { - return { - status: 'ok', - res, - }; - } else { - return { - status: 'permerror', - }; - } + if (res == null) return { status: 'permerror' }; + return { status: 'ok', res }; } catch (e) { return { status: (e instanceof StatusError && e.isClientError) ? 'permerror' : 'temperror',