fix(desktop): disable project deep links
This commit is contained in:
@@ -2074,10 +2074,6 @@ const dispatchDeepLink = (link) => {
|
|||||||
emitToAllWindows('openchamber:open-session', { sessionId: link.value });
|
emitToAllWindows('openchamber:open-session', { sessionId: link.value });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (link.type === 'project' && link.value) {
|
|
||||||
emitToAllWindows('openchamber:open-project', { projectPath: link.value });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (link.type === 'host' && link.value) {
|
if (link.type === 'host' && link.value) {
|
||||||
void switchToHostById(link.value);
|
void switchToHostById(link.value);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -668,26 +668,6 @@ function App({ apis }: AppProps) {
|
|||||||
return () => window.removeEventListener('openchamber:open-draft-session', handler as EventListener);
|
return () => window.removeEventListener('openchamber:open-draft-session', handler as EventListener);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
React.useEffect(() => {
|
|
||||||
if (typeof window === 'undefined') return;
|
|
||||||
|
|
||||||
const handler = (event: Event) => {
|
|
||||||
const detail = (event as CustomEvent<{ projectPath?: string }>).detail;
|
|
||||||
const projectPath = typeof detail?.projectPath === 'string' ? detail.projectPath.trim() : '';
|
|
||||||
if (!projectPath) return;
|
|
||||||
const projectsStore = useProjectsStore.getState();
|
|
||||||
const existing = projectsStore.projects.find((project) => project.path === projectPath);
|
|
||||||
if (existing) {
|
|
||||||
projectsStore.setActiveProject(existing.id);
|
|
||||||
} else {
|
|
||||||
projectsStore.addProject(projectPath);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener('openchamber:open-project', handler as EventListener);
|
|
||||||
return () => window.removeEventListener('openchamber:open-project', handler as EventListener);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (typeof window === 'undefined') return;
|
if (typeof window === 'undefined') return;
|
||||||
if (!isInitialized || isSwitchingDirectory) return;
|
if (!isInitialized || isSwitchingDirectory) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user