diff --git a/client/web/src/components/app.tsx b/client/web/src/components/app.tsx index cf06ee724..8b10ae475 100644 --- a/client/web/src/components/app.tsx +++ b/client/web/src/components/app.tsx @@ -4,25 +4,29 @@ import LegacyClientView from "src/components/views/legacy-client-view" import LoginClientView from "src/components/views/login-client-view" import ReadonlyClientView from "src/components/views/readonly-client-view" import useAuth from "src/hooks/auth" -import useNodeData, { NodeData } from "src/hooks/node-data" +import useNodeData from "src/hooks/node-data" import ManagementClientView from "./views/management-client-view" export default function App() { const { data, refreshData, updateNode } = useNodeData() + const { data: auth, loading: loadingAuth, waitOnAuth } = useAuth() return (
- {!data ? ( -
Loading...
// TODO(sonia): add a loading view + {!data || loadingAuth ? ( +
Loading...
// TODO(sonia): add a loading view ) : data?.Status === "NeedsLogin" || data?.Status === "NoState" ? ( // Client not on a tailnet, render login. updateNode({ Reauthenticate: true })} /> + ) : data.DebugMode === "full" && auth?.ok ? ( + // Render new client interface in management mode. + ) : data.DebugMode === "login" || data.DebugMode === "full" ? ( - // Render new client interface. - + // Render new client interface in readonly mode. + ) : ( // Render legacy client interface. )} - {data &&
) } -function WebClient(props: NodeData) { - const { data: auth, loading: loadingAuth, waitOnAuth } = useAuth() - - if (loadingAuth) { - return
Loading...
- } - - return props.DebugMode === "full" && auth?.ok ? ( - - ) : ( - - ) -} - export function Footer(props: { licensesURL: string; className?: string }) { return (