mirror of
https://github.com/outline/outline.git
synced 2026-12-06 19:22:29 +03:00
* 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>
41 lines
1.1 KiB
TypeScript
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;
|