diff --git a/src/masto/timelines.ts b/src/masto/timelines.ts index 19abea7..f7bb5a3 100644 --- a/src/masto/timelines.ts +++ b/src/masto/timelines.ts @@ -288,23 +288,20 @@ export function createTimeline< } }); - untrack(() => { - for (const status of chk.chunk) { - const node = lookup.get(status.id)!; - const parent = status.inReplyToId - ? lookup.get(status.inReplyToId) - : undefined; - - if (parent) { - const children = parent.children ?? []; - if (!children.find((x) => x.value.id == status.id)) { - children.push(node); - } - parent.children = children; - node.parent = parent; + for (const status of chk.chunk) { + const node = untrack(() => lookup.get(status.id))!; + const parent = untrack(() => + status.inReplyToId ? lookup.get(status.inReplyToId) : undefined, + ); + if (parent) { + const children = parent.children ?? []; + if (!children.find((x) => x.value.id == status.id)) { + children.push(node); } + parent.children = children; + node.parent = parent; } - }); + } const nThreadIds = chk.chunk .filter((x, i) => !existence[i]) @@ -317,11 +314,9 @@ export function createTimeline< setThreads((threads) => [...nThreadIds, ...threads]); } - untrack(() => { - setThreads((threads) => - threads.filter((id) => (lookup.get(id)!.children?.length ?? 0) === 0), - ); - }); + setThreads((threads) => + threads.filter((id) => (lookup.get(id)!.children?.length ?? 0) === 0), + ); }); }); diff --git a/src/timelines/TootComposer.tsx b/src/timelines/TootComposer.tsx index 50d5e0e..60e6bc5 100644 --- a/src/timelines/TootComposer.tsx +++ b/src/timelines/TootComposer.tsx @@ -3,6 +3,8 @@ import { createMemo, createRenderEffect, createSignal, + createUniqueId, + onMount, Show, type Accessor, type Component, @@ -41,12 +43,14 @@ import { } from "@suid/icons-material"; import type { Account } from "../accounts/stores"; import "./TootComposer.css"; +import { makeEventListener } from "@solid-primitives/event-listener"; import BottomSheet from "../material/BottomSheet"; import { useLanguage } from "../platform/i18n"; import iso639_1 from "iso-639-1"; import ChooseTootLang from "./ChooseTootLang"; import type { mastodon } from "masto"; import cardStyles from "../material/cards.module.css"; +import { Title } from "../material/typography"; import Menu, { createManagedMenuState } from "../material/Menu"; import { useDefaultSession } from "../masto/clients"; import { resolveCustomEmoji } from "../masto/toot";