Compare commits

..

2 Commits

Author SHA1 Message Date
Eduard Gert
8eebec78b4 Preserve query params for ssh and rdp (#559)
Some checks failed
build and push / build_n_push (push) Has been cancelled
2026-02-16 17:34:08 +01:00
raghvendra
3e01a6dafd refactor: simplify FullScreenLoading to use boolean prop instead of string union (#555) 2026-02-16 11:10:26 +01:00
6 changed files with 12 additions and 12 deletions

View File

@@ -6,5 +6,5 @@ import React from "react";
export default function Redirect() {
useRedirect("/events/audit");
return <FullScreenLoading height={"auto"} />;
return <FullScreenLoading fullScreen={false} />;
}

View File

@@ -11,5 +11,5 @@ export default function DNS() {
router.push("/dns/nameservers");
}, [router]);
return <FullScreenLoading height={"auto"} />;
return <FullScreenLoading fullScreen={false} />;
}

View File

@@ -11,5 +11,5 @@ export default function ReverseProxyRedirectPage() {
router.replace("/reverse-proxy/services");
}, [router]);
return <FullScreenLoading height={"auto"} />;
return <FullScreenLoading fullScreen={false} />;
}

View File

@@ -11,5 +11,5 @@ export default function Team() {
router.push("/team/users");
}, [router]);
return <FullScreenLoading height={"auto"} />;
return <FullScreenLoading fullScreen={false} />;
}

View File

@@ -4,6 +4,7 @@ import * as React from "react";
import { useEffect } from "react";
const QUERY_PARAMS_KEY = "netbird-query-params";
const PRESERVE_QUERY_PARAMS_PATHS = ["/peer/ssh", "/peer/rdp"];
const VALID_PARAMS = [
"tab",
"search",
@@ -28,9 +29,9 @@ export const SecureProvider = ({ children }: Props) => {
const currentPath = usePathname();
useEffect(() => {
if (isAuthenticated) {
if (isAuthenticated && !PRESERVE_QUERY_PARAMS_PATHS.includes(currentPath)) {
localStorage.removeItem(QUERY_PARAMS_KEY);
} else {
} else if (!isAuthenticated) {
try {
const params = window.location.search.substring(1);
if (params) {
@@ -41,7 +42,7 @@ export const SecureProvider = ({ children }: Props) => {
}
} catch (e) {}
}
}, [isAuthenticated]);
}, [isAuthenticated, currentPath]);
useEffect(() => {
let timeout: NodeJS.Timeout | undefined = undefined;

View File

@@ -2,18 +2,17 @@ import { cn } from "@utils/helpers";
import LoadingIcon from "@/assets/icons/LoadingIcon";
type Props = {
height?: "screen" | "auto";
fullScreen?: boolean
};
export default function FullScreenLoading({ height = "screen" }: Props) {
export default function FullScreenLoading({ fullScreen = true }: Props) {
return (
<div
className={cn(
"flex items-center justify-center w-screen",
height == "screen" && "h-screen",
height == "auto" && "h-auto",
fullScreen && "h-screen",
)}
>
<LoadingIcon className={"fill-netbird"} size={44} />
<LoadingIcon className="fill-netbird" size={44} />
</div>
);
}