don't recursively render note previews
This commit is contained in:
parent
6c77be64b6
commit
38d4a7fd56
7 changed files with 34 additions and 7 deletions
17
packages/frontend/src/utility/get-self-note-ids.ts
Normal file
17
packages/frontend/src/utility/get-self-note-ids.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type * as Misskey from 'misskey-js';
|
||||
|
||||
/**
|
||||
* Gets IDs of notes that are visibly the "same" as the current note.
|
||||
* These are IDs that should not be recursively resolved when starting from the provided note as entry.
|
||||
*/
|
||||
export function getSelfNoteIds(note: Misskey.entities.Note): string[] {
|
||||
const ids = [note.id]; // Regular note
|
||||
if (note.renote) ids.push(note.renote.id); // Renote or quote
|
||||
if (note.renote?.renote) ids.push(note.renote.renote.id); // Renote *of* a quote
|
||||
return ids;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue