mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fix(renderAdminReport): make sure reportedPubkey is not undefined
This commit is contained in:
parent
d3b7668a1e
commit
323e425e8b
1 changed files with 6 additions and 1 deletions
|
|
@ -49,6 +49,11 @@ async function renderAdminReport(reportEvent: DittoEvent, opts: RenderAdminRepor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reportedPubkey = reportEvent.tags.find(([name]) => name === 'p')![1];
|
||||||
|
if (!reportedPubkey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: reportEvent.id,
|
id: reportEvent.id,
|
||||||
action_taken: actionTaken,
|
action_taken: actionTaken,
|
||||||
|
|
@ -62,7 +67,7 @@ async function renderAdminReport(reportEvent: DittoEvent, opts: RenderAdminRepor
|
||||||
: await renderAdminAccountFromPubkey(reportEvent.pubkey),
|
: await renderAdminAccountFromPubkey(reportEvent.pubkey),
|
||||||
target_account: reportEvent.reported_profile
|
target_account: reportEvent.reported_profile
|
||||||
? await renderAdminAccount(reportEvent.reported_profile)
|
? await renderAdminAccount(reportEvent.reported_profile)
|
||||||
: await renderAdminAccountFromPubkey(reportEvent.tags.find(([name]) => name === 'p')![1]),
|
: await renderAdminAccountFromPubkey(reportedPubkey),
|
||||||
assigned_account: null,
|
assigned_account: null,
|
||||||
action_taken_by_account: null,
|
action_taken_by_account: null,
|
||||||
statuses,
|
statuses,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue