Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions apps/web/src/components/BranchToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useStat

import { useComposerDraftStore, type DraftId } from "../composerDraftStore";
import { EnvironmentMachineIcon } from "./EnvironmentMachineIcon";
import { useProject, useThread, useThreadShellsForProjectRefs } from "../state/entities";
import { useProject, useThreadShell, useThreadShellsForProjectRefs } from "../state/entities";
import {
type EnvMode,
type EnvironmentOption,
Expand Down Expand Up @@ -465,7 +465,7 @@ export const BranchToolbar = memo(function BranchToolbar({
const draftThread = useComposerDraftStore((store) =>
draftId ? store.getDraftSession(draftId) : store.getDraftThreadByRef(threadRef),
);
const serverThread = useThread(threadRef, { waitForShell: draftThread !== null });
const serverThread = useThreadShell(threadRef);
const setDraftThreadContext = useComposerDraftStore((store) => store.setDraftThreadContext);
const activeProjectRef = serverThread
? scopeProjectRef(serverThread.environmentId, serverThread.projectId)
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/BranchToolbarBranchSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { readLocalApi } from "../localApi";
import { useOpenPrLink } from "../lib/openPullRequestLink";
import { shouldLoadNextBranchPageAfterScroll } from "../state/paginatedBranches";
import { usePaginatedBranches } from "../state/queries";
import { useProject, useThread } from "../state/entities";
import { useProject, useThreadShell } from "../state/entities";
import { useEnvironmentQuery } from "../state/query";
import { threadEnvironment } from "../state/threads";
import { useAtomCommand } from "../state/use-atom-command";
Expand Down Expand Up @@ -119,7 +119,7 @@ export function BranchToolbarBranchSelector({
const draftThread = useComposerDraftStore((store) =>
draftId ? store.getDraftSession(draftId) : store.getDraftThreadByRef(threadRef),
);
const serverThread = useThread(threadRef, { waitForShell: draftThread !== null });
const serverThread = useThreadShell(threadRef);
const serverSession = serverThread?.session ?? null;
const setDraftThreadContext = useComposerDraftStore((store) => store.setDraftThreadContext);

Expand Down
6 changes: 2 additions & 4 deletions apps/web/src/components/GitActionsControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ import {
useVcsInitAction,
useVcsPullAction,
} from "~/lib/sourceControlActions";
import { useThread } from "~/state/entities";
import { useThreadShell } from "~/state/entities";
import { useEnvironmentQuery } from "~/state/query";
import { serverEnvironment } from "~/state/server";
import { sourceControlEnvironment } from "~/state/sourceControl";
Expand Down Expand Up @@ -1009,9 +1009,7 @@ export default function GitActionsControl({
? store.getDraftThreadByRef(activeThreadRef)
: null,
);
const activeServerThread = useThread(activeThreadRef, {
waitForShell: activeDraftThread !== null,
});
const activeServerThread = useThreadShell(activeThreadRef);
const setDraftThreadContext = useComposerDraftStore((store) => store.setDraftThreadContext);
const [isCommitDialogOpen, setIsCommitDialogOpen] = useState(false);
const [dialogCommitMessage, setDialogCommitMessage] = useState("");
Expand Down
Loading