refactor: dont need exist check, if post doesnt exist getPostData returns null

This commit is contained in:
Barış Soner Uşaklı
2024-06-12 16:04:14 -04:00
parent cdc6f9f6a3
commit b2d03da96d

View File

@@ -244,9 +244,8 @@ Notes.getParentChain = async (uid, input) => {
return await traverse(uid, localId);
}
const exists = await db.exists(`post:${id}`);
if (exists) {
const postData = await posts.getPostData(id);
const postData = await posts.getPostData(id);
if (postData) {
chain.add(postData);
if (postData.toPid) {
await traverse(uid, postData.toPid);