A different way of making this work

This commit is contained in:
CatAClock 2025-07-18 11:21:26 -07:00
parent 3a646be50e
commit 3b665e8ca8

View file

@ -206,18 +206,17 @@ export async function CreatePost(DID, Text, ContentWarning = undefined, Tags = [
let Facets = [];
let LengthStuff = 0;
for (let i of Tags) {
let ThineIndex = Tags.indexOf(i, LengthStuff);
Facets.push({
"index": {
"byteStart": ThineIndex,
"byteEnd": ThineIndex + i.length
"byteStart": LengthStuff,
"byteEnd": LengthStuff + i.length
},
"features": [{
"$type": "app.bsky.richtext.facet#tag",
"tag": i
}]
});
LengthStuff = ThineIndex + i.length;
LengthStuff += 1;
}
Record.facets = Facets;
}