mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 21:23:07 +00:00
fix: Open in Browser button not working on Windows
The handleOpenDevServerUrl function was looking up the dev server info using an un-normalized path, but the Map stores entries with normalized paths (forward slashes). On Windows, paths come in as C:\Projects\foo but stored keys use C:/Projects/foo (normalized). The lookup used the raw path, so it never matched. Fix: Use getWorktreeKey() helper which normalizes the path, consistent with how isDevServerRunning() and getDevServerInfo() already work.
This commit is contained in:
@@ -114,13 +114,12 @@ export function useDevServers({ projectPath }: UseDevServersOptions) {
|
|||||||
|
|
||||||
const handleOpenDevServerUrl = useCallback(
|
const handleOpenDevServerUrl = useCallback(
|
||||||
(worktree: WorktreeInfo) => {
|
(worktree: WorktreeInfo) => {
|
||||||
const targetPath = worktree.isMain ? projectPath : worktree.path;
|
const serverInfo = runningDevServers.get(getWorktreeKey(worktree));
|
||||||
const serverInfo = runningDevServers.get(targetPath);
|
|
||||||
if (serverInfo) {
|
if (serverInfo) {
|
||||||
window.open(serverInfo.url, '_blank');
|
window.open(serverInfo.url, '_blank');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[projectPath, runningDevServers]
|
[runningDevServers, getWorktreeKey]
|
||||||
);
|
);
|
||||||
|
|
||||||
const isDevServerRunning = useCallback(
|
const isDevServerRunning = useCallback(
|
||||||
|
|||||||
Reference in New Issue
Block a user