27 lines · 734 B · TypeScript
RawDownload
import type { EnvironmentThreadStatus } from "@t3tools/client-runtime/state/threads"; export type ThreadSyncPhase = "loading" | "syncing"; export function resolveThreadSyncPhase(input: {  readonly detailExists: boolean;  readonly shellExists: boolean;  readonly status: EnvironmentThreadStatus;}): ThreadSyncPhase | null {  if (!input.shellExists) {    return null;  }   switch (input.status) {    case "empty":    case "cached":    case "synchronizing":      return input.detailExists ? "syncing" : "loading";    case "deleted":    case "live":      return null;  }} export function threadSyncLabel(phase: ThreadSyncPhase): string {  return phase === "loading" ? "Loading messages..." : "Syncing messages...";}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t