From 5c8814d6a975771c759dab72c23c30ebba929c94 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Tue, 7 Nov 2023 09:46:21 +0100 Subject: [PATCH] Revert "feat(web): ui-3: redirect to dataset page if there is a saved dataset" This reverts commit 1f8c26f0233e4cbb18aad66eacc30601f72b9e75. --- packages_rs/nextclade-web/src/pages/_app.tsx | 28 ++------------------ 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/packages_rs/nextclade-web/src/pages/_app.tsx b/packages_rs/nextclade-web/src/pages/_app.tsx index bb418c6b7..c4b2e96c3 100644 --- a/packages_rs/nextclade-web/src/pages/_app.tsx +++ b/packages_rs/nextclade-web/src/pages/_app.tsx @@ -3,12 +3,11 @@ import 'reflect-metadata' import 'css.escape' import { isEmpty, isNil } from 'lodash' -import React, { useEffect, Suspense, useMemo, PropsWithChildren } from 'react' +import React, { useEffect, Suspense, useMemo } from 'react' import { RecoilEnv, RecoilRoot, useRecoilCallback, useRecoilState, useRecoilValue } from 'recoil' import { AppProps } from 'next/app' import { useRouter } from 'next/router' import dynamic from 'next/dynamic' -import { DatasetPage } from 'src/components/Main/DatasetPage' import { sanitizeError } from 'src/helpers/sanitizeError' import { useRunAnalysis } from 'src/hooks/useRunAnalysis' import i18nAuspice, { changeAuspiceLocale } from 'src/i18n/i18n.auspice' @@ -173,27 +172,6 @@ export function RecoilStateInitializer() { return null } -// HACK: primitive router. Replace with something more sturdy -function Router({ children }: PropsWithChildren) { - const { asPath } = useRouter() - const dataset = useRecoilValue(datasetCurrentAtom) - const fallback = useMemo(() => , []) - - const { Component } = useMemo(() => { - if (asPath !== '/dataset' && !isNil(dataset)) { - return { Component: } - } - return { Component: children } - }, [asPath, children, dataset]) - - return ( - - - {Component} - - ) -} - const REACT_QUERY_OPTIONS: QueryClientConfig = { defaultOptions: { queries: { suspense: true, retry: 1 } }, } @@ -229,9 +207,7 @@ export function MyApp({ Component, pageProps, router }: AppProps) { - - - +