infinite query, rename file to queries

This commit is contained in:
Samuel Newman
2026-01-16 16:33:12 +02:00
parent 2f731146f8
commit 92824b4b3a
5 changed files with 45 additions and 42 deletions
+3 -5
View File
@@ -1,7 +1,7 @@
/**
* Type converters for Draft API - convert between ComposerState and server Draft types.
*/
import {type AppBskyDraftDefs} from '@atproto/api'
import {type AppBskyDraftDefs, RichText} from '@atproto/api'
import {nanoid} from 'nanoid/non-secure'
import {type ComposerImage} from '#/state/gallery'
@@ -341,11 +341,9 @@ export function draftToComposerPosts(
draft: AppBskyDraftDefs.Draft,
loadedMedia: Map<string, string>,
): PostDraft[] {
// Import these dynamically to avoid circular dependencies
const {RichText} = require('@atproto/api')
return draft.posts.map((post, index) => {
const richtext = new RichText({text: post.text || ''})
richtext.detectFacetsWithoutResolution()
const embed: EmbedDraft = {
quote: undefined,
@@ -434,7 +432,7 @@ export function draftToComposerPosts(
// Parse labels
const labels: string[] = []
if (post.labels && 'values' in post.labels) {
for (const val of (post.labels as {values: {val: string}[]}).values) {
for (const val of post.labels.values) {
labels.push(val.val)
}
}