Render article drafts when opened directly

This commit is contained in:
2024-10-22 15:55:18 +02:00
parent fdb13bc65d
commit c0a02295c1
4 changed files with 40 additions and 5 deletions

View File

@@ -17,14 +17,25 @@ export async function fetchReplaceableEvent(
pubkey: string,
identifier: string,
) {
const events = await relay.query([{
let events = await relay.query([{
authors: [pubkey],
kinds: [30023],
"#d": [identifier],
limit: 1,
}]);
return events.length > 0 ? events[0] : null;
if (events.length > 0) {
return events[0];
} else {
events = await relay.query([{
authors: [pubkey],
kinds: [30024],
"#d": [identifier],
limit: 1,
}]);
return events.length > 0 ? events[0] : null;
}
}
export async function fetchArticlesByAuthor(pubkey: string) {