Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/mobile/src/components/agents/new-session-screen-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,21 @@ export function NewSessionScreenBody() {
}
}

// The composer mounts before `user.getMe` resolves, so a prompt typed in that
// window has no account to write under and `handlePromptChange` skips the
// save. Persist the current prompt once the identity arrives (and if it
// changes), so text typed before the query settled survives a background or
// kill rather than waiting for the next keystroke.
useEffect(() => {
Comment thread
iscekic marked this conversation as resolved.
if (isCloneEntry || !userId) {
return;
}
const text = promptRef.current;
if (text.trim().length > 0) {
saveDraft(userId, NEW_SESSION_DRAFT_KEY, text);
}
}, [userId, isCloneEntry, promptRef]);

// Discard confirm: leaving with a non-empty prompt or unsent uploads asks
// first. Discard clears the stored draft and the route-owned prompt ref, then
// releases admitted uploads before the captured navigation action is
Expand Down
5 changes: 4 additions & 1 deletion apps/mobile/src/lib/use-new-session-repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type UseNewSessionReposResult = {
recents: NewSessionRepository[];
groups: RepositoryGroup[];
isRetrying: boolean;
/** True once every provider query has settled and at least one repo is visible. */
/** True once every provider query has settled without error and at least one repo is visible. */
reposSettled: boolean;
openIntegration: (platform: RepositoryPlatform) => void;
refreshReposForceFresh: () => Promise<void>;
Expand Down Expand Up @@ -365,6 +365,9 @@ export function useNewSessionRepos({
!githubQuery.isLoading &&
!gitlabQuery.isLoading &&
!bitbucketQuery.isLoading &&
!githubQuery.isError &&
!gitlabQuery.isError &&
!bitbucketQuery.isError &&
repositories.length > 0;

return {
Expand Down
Loading