File tree Expand file tree Collapse file tree
apps/mobile/src/features/threads Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type { WorktreeSetupCardProps } from "./worktree-setup-card";
99import type { ComposerTextPaste } from "../../native/T3ComposerEditor.types" ;
1010import { type EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection" ;
1111import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell" ;
12+ import { threadWokeAt } from "@t3tools/client-runtime/state/thread-settled" ;
1213import type { HandoffEndpoints } from "@t3tools/client-runtime/handoff" ;
1314import {
1415 childThreadInputsTitle ,
@@ -787,7 +788,15 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai
787788 const lastDispatchedVisitRef = useRef < string | null > ( null ) ;
788789 const lastVisitDispatchRef = useRef ( { threadKey : selectedThreadKey , at : 0 } ) ;
789790 const selectedThreadId = props . selectedThread . id ;
790- const selectedThreadUpdatedAt = props . selectedThread . updatedAt ;
791+ const selectedThreadWokeAt = threadWokeAt ( props . selectedThread , {
792+ now : new Date ( ) . toISOString ( ) ,
793+ } ) ;
794+ // A scheduled wake can happen without a newer server update.
795+ const selectedThreadUpdatedAt =
796+ selectedThreadWokeAt !== null &&
797+ Date . parse ( selectedThreadWokeAt ) > Date . parse ( props . selectedThread . updatedAt )
798+ ? selectedThreadWokeAt
799+ : props . selectedThread . updatedAt ;
791800 const selectedThreadLastVisitedAt = props . selectedThread . lastVisitedAt ;
792801 const selectedThreadCompletedAt = props . selectedThread . latestRun ?. completedAt ;
793802 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments