fix(app): stabilize terminal creation handler
This commit is contained in:
@@ -1264,8 +1264,7 @@ function WorkspaceScreenContent({
|
|||||||
[focusWorkspacePane, openWorkspaceDraftTab, persistenceKey],
|
[focusWorkspacePane, openWorkspaceDraftTab, persistenceKey],
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleCreateTerminal = useCallback(
|
const handleCreateTerminal = useStableEvent((input?: { paneId?: string }) => {
|
||||||
(input?: { paneId?: string }) => {
|
|
||||||
if (createTerminalMutation.isPending || pendingTerminalCreateInput) {
|
if (createTerminalMutation.isPending || pendingTerminalCreateInput) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1282,16 +1281,7 @@ function WorkspaceScreenContent({
|
|||||||
|
|
||||||
setPendingTerminalCreateInput(input ?? {});
|
setPendingTerminalCreateInput(input ?? {});
|
||||||
toast.show("Preparing workspace, opening terminal when ready...");
|
toast.show("Preparing workspace, opening terminal when ready...");
|
||||||
},
|
});
|
||||||
[
|
|
||||||
canCreateTerminalNow,
|
|
||||||
createTerminalMutation,
|
|
||||||
hasHydratedWorkspaces,
|
|
||||||
isMissingWorkspaceExecutionAuthority,
|
|
||||||
pendingTerminalCreateInput,
|
|
||||||
toast,
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleSelectSwitcherTab = useCallback(
|
const handleSelectSwitcherTab = useCallback(
|
||||||
(key: string) => {
|
(key: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user