Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Feb 12, 2024
1 parent 694d93c commit 999d5c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@
function parse30066(event) {
const parsedTags = {};
const url = event.tags.filter( tag => tag[0] == 'd')[0][1]
event.tags = event.tags.filter( tag => tag.length >= 3)
event.tags.forEach(tag => {
const url = event.tags.filter( tag => tag[0] == 'd')?.[0]?.[1]
if(!url) return { error: "no d tag?" }
const tags = event.tags.filter( tag => tag.length >= 3)
tags.forEach(tag => {
const [key, subkey, ...values] = tag;
if (!parsedTags[key]) {
parsedTags[key] = {};
Expand All @@ -191,6 +192,7 @@ function parse30066(event) {
}
}
});
if(!parsedTags?.rtt?.open) return { error: "no rtt connect tag?", tags: tags }
return { url, ...parsedTags};
}
function castValue(value) {
Expand Down

0 comments on commit 999d5c6

Please sign in to comment.