Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions new-ui/src/routes/empty.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
import { useQuery } from '@tanstack/react-query';
import { createFileRoute, useNavigate } from '@tanstack/react-router';
import { useEffect } from 'react';
import { getCurrentWindow } from '@tauri-apps/api/window';
import { useEffect, useMemo } from 'react';

import { hasAnyVisibleLocationsQueryOptions } from '../shared/rust-api/query';
import { WindowId } from '../shared/consts';
import {
getInstancesQueryOptions,
getTunnelsQueryOptions,
} from '../shared/rust-api/query';

export const Route = createFileRoute('/empty')({
component: RouteComponent,
});

function RouteComponent() {
const navigate = useNavigate();
const { data: hasLocations } = useQuery(hasAnyVisibleLocationsQueryOptions);
const { data: instances } = useQuery(getInstancesQueryOptions);
const { data: tunnels } = useQuery(getTunnelsQueryOptions);

const hasContent = useMemo(
() => (instances?.length ?? 0) > 0 || (tunnels?.length ?? 0) > 0,
[instances, tunnels],
);

useEffect(() => {
if (hasLocations === true) {
void navigate({ to: '/' });
}
}, [hasLocations, navigate]);
if (!hasContent) return;
const to = getCurrentWindow().label === WindowId.CompactView ? '/compact' : '/full';
void navigate({ to, replace: true });
}, [hasContent, navigate]);

return <div></div>;
}
6 changes: 3 additions & 3 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src-tauri/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ ignore = [
{ id = "RUSTSEC-2024-0436", reason = "Unmaintained netlink dependency" },
{ id = "RUSTSEC-2026-0194", reason = "quick-xml <0.41 pulled by Tauri/plist; no compatible upstream update yet" },
{ id = "RUSTSEC-2026-0195", reason = "quick-xml <0.41 pulled by Tauri/plist; no compatible upstream update yet" },
{ id = "RUSTSEC-2026-0346", reason = "rustls <0.23.46 pulled by reqwest/hyper-rustls; client session store Debug leak, not used" },
{ id = "RUSTSEC-2026-0347", reason = "rustls <0.23.46 pulled by reqwest/hyper-rustls; ECH not used" },
{ id = "RUSTSEC-2026-0348", reason = "rustls <0.23.46 pulled by reqwest/hyper-rustls; brotli cert compression feature not enabled" },
{ id = "RUSTSEC-2026-0349", reason = "rustls <0.23.46 pulled by reqwest/hyper-rustls; PQ key exchange downgrade, no key compromise" },
# The "unmaintained" advisories below stem from our use of Tauri v2, which
# depends on GTK3 bindings that are no longer maintained.
{ id = "RUSTSEC-2024-0370", reason = "Tauri v2 GTK3 dependency (unmaintained)" },
Expand Down
Loading