Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

threadContextDrop.logic.ts

12 lines461 Bytes

1import type { ScopedThreadRef } from "@t3tools/contracts";
2import { threadContextRecord } from "@t3tools/shared/composerContextReferences";
3​
4export type ThreadContextDropRef = ScopedThreadRef & { readonly title?: string };
5​
6export function droppedThreadContextRecord(
7 ref: ThreadContextDropRef,
8 shell: { readonly title: string } | null,
9) {
10 const title = ref.title ?? shell?.title;
11 return title === undefined ? null : threadContextRecord(ref, title);