Skip to content

Commit acf7ecf

Browse files
committed
Fix dead diff type check, normalize path join, reorder hooks
1 parent 6045b2d commit acf7ecf

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

apps/code/src/renderer/features/task-detail/components/ExternalAppsOpener.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function ExternalAppsOpener({
2020
label = "Open",
2121
}: ExternalAppsOpenerProps) {
2222
const { detectedApps, defaultApp, isLoading } = useExternalApps();
23+
const [dropdownOpen, setDropdownOpen] = useState(false);
2324

2425
const handleOpenDefault = useCallback(async () => {
2526
if (!defaultApp || !targetPath) return;
@@ -74,8 +75,6 @@ export function ExternalAppsOpener({
7475
[handleCopyPath],
7576
);
7677

77-
const [dropdownOpen, setDropdownOpen] = useState(false);
78-
7978
if (!targetPath) {
8079
return null;
8180
}

apps/code/src/renderer/features/task-detail/components/TaskDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ export function TaskDetail({ task: initialTask }: TaskDetailProps) {
4646
if (!panel) return null;
4747

4848
const parsed = parseTabId(panel.content.activeTabId);
49-
if (parsed.type === "file" || parsed.type === "diff") {
49+
if (parsed.type === "file") {
5050
return parsed.value;
5151
}
5252
return null;
5353
});
5454

5555
const openTargetPath =
5656
activeRelativePath && effectiveRepoPath
57-
? `${effectiveRepoPath}/${activeRelativePath}`
57+
? [effectiveRepoPath, activeRelativePath].join("/").replace(/\/+/g, "/")
5858
: effectiveRepoPath;
5959

6060
const [filePickerOpen, setFilePickerOpen] = useState(false);

0 commit comments

Comments
 (0)