Files
outline/app/scenes/DesktopRedirect.tsx
T
Tom MoorandClaude Opus 5 cc15b088ec feat: Show a toast with actions when a file download completes in the desktop app (#13769)
* Show toast with actions when a file download completes

In the desktop app a toast is now displayed when a file finishes
downloading, with the option to open the file or reveal it in the file
manager of the operating system.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kat47mueTm3CUZSbDVfBas

* Guard download bridge calls for older desktop apps

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kat47mueTm3CUZSbDVfBas

* Change protocol in dev for easier testing

* Use standard buttons stacked below the file name in download toast

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-17 19:36:47 -04:00

41 lines
1.1 KiB
TypeScript

import { useEffect } from "react";
import styled from "styled-components";
import Flex from "~/components/Flex";
import useQuery from "~/hooks/useQuery";
import Desktop from "~/utils/Desktop";
import { SigningIn } from "./Login/components/SigningIn";
const DesktopRedirect = () => {
const params = useQuery();
const token = params.get("token");
useEffect(() => {
if (token) {
window.open(
`${Desktop.protocol}://${window.location.host}/auth/redirect?token=${token}`,
"_self"
);
// Clean the url after a short delay so it's not possible to hit reload, re-using the transfer token
// will not work and changing the location immediately cancels the window.open call in Safari.
setTimeout(() => (window.location.search = ""), 500);
}
}, [token]);
return (
<Centered align="center" justify="center" column auto>
<SigningIn />
</Centered>
);
};
const Centered = styled(Flex)`
user-select: none;
width: 90vw;
height: 100%;
max-width: 320px;
margin: 0 auto;
`;
export default DesktopRedirect;