Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.
11 changes: 11 additions & 0 deletions packages/teleport/src/DesktopSession/DesktopSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ function Session(props: PropsWithChildren<State>) {
isSharingDirectory={isSharingDirectory}
onShareDirectory={() => {
setIsSharingDirectory(true);
const sharedDirHandle = window
.showDirectoryPicker()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to handle browsers which don't support this API?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I left that as a "known issue" for now: #959

.then(sharedDirHandle => {
console.log(sharedDirHandle);
});
}}
/>

Expand Down Expand Up @@ -218,3 +223,9 @@ const DesktopSessionAlert = styled(Alert)`
align-self: center;
min-width: 450px;
`;

declare global {
interface Window {
showDirectoryPicker: () => Promise<FileSystemDirectoryHandle>;
}
}