Remove the need for a separate page
This commit is contained in:
parent
cb94dd8b42
commit
949a42004f
2 changed files with 9 additions and 20 deletions
|
@ -1,20 +0,0 @@
|
|||
import { Container } from "components/Container";
|
||||
import { Spinner } from "components/Spinner";
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
const Page: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const currentURL = new URL(window.location.href);
|
||||
const desktopRedirectURL = new URL("ente://app/gallery");
|
||||
desktopRedirectURL.search = currentURL.search;
|
||||
window.location.href = desktopRedirectURL.href;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Spinner />
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
|
@ -292,6 +292,15 @@ const redirectToApp = (
|
|||
status: RedirectStatus,
|
||||
reason?: FailureReason,
|
||||
) => {
|
||||
// The desktop app passes "<our-origin>/desktop-redirect" as `redirectURL`.
|
||||
// This is just a placeholder, we want to intercept this and instead
|
||||
// redirect to the ente:// scheme protocol handler that is internally being
|
||||
// used by the desktop app.
|
||||
if (new URL(redirectURL).pathname == "/desktop-redirect") {
|
||||
redirectToApp("ente://app/gallery", status, reason);
|
||||
return;
|
||||
}
|
||||
|
||||
let url = `${redirectURL}?status=${status}`;
|
||||
if (reason) url = `${url}&reason=${reason}`;
|
||||
window.location.href = url;
|
||||
|
|
Loading…
Reference in a new issue