diff --git a/app/packages/dataset/src/Dataset.tsx b/app/packages/dataset/src/Dataset.tsx index 50dc1593ae..e57e0e0a6e 100644 --- a/app/packages/dataset/src/Dataset.tsx +++ b/app/packages/dataset/src/Dataset.tsx @@ -16,24 +16,19 @@ import { } from "@fiftyone/core"; import { usePlugins } from "@fiftyone/plugins"; import * as fos from "@fiftyone/state"; -import { getEventSource, toCamelCase } from "@fiftyone/utilities"; -import { getEnvironment, RelayEnvironmentKey, State } from "@fiftyone/state"; -import React, { useEffect, useState, Suspense } from "react"; -import { PreloadedQuery, useQueryLoader, usePreloadedQuery } from "react-relay"; +import { getEnvironment, RelayEnvironmentKey } from "@fiftyone/state"; +import React, { useState, Suspense } from "react"; +import { PreloadedQuery, useQueryLoader } from "react-relay"; import { RecoilRoot, useRecoilValue, useSetRecoilState } from "recoil"; import { RecoilRelayEnvironmentProvider } from "recoil-relay"; import styled from "styled-components"; -import { DatasetQuery, DatasetQuery$data } from "@fiftyone/core"; +import { DatasetQuery } from "@fiftyone/core"; // built-in plugins import "@fiftyone/looker-3d"; import "@fiftyone/map"; -enum Events { - STATE_UPDATE = "state_update", -} - const Container = styled.div` width: 100%; height: 100%; @@ -96,7 +91,6 @@ export const DatasetRenderer: React.FC = ({ setCompactLayout(compactLayout); }, [compactLayout]); React.useEffect(() => { - console.log(dataset); loadQuery({ name: dataset }); }, [dataset]); React.useLayoutEffect(() => { diff --git a/app/packages/state/src/hooks/useSetView.ts b/app/packages/state/src/hooks/useSetView.ts index 53889736b2..6108f1c69d 100644 --- a/app/packages/state/src/hooks/useSetView.ts +++ b/app/packages/state/src/hooks/useSetView.ts @@ -73,13 +73,16 @@ const useSetView = ( }, onError, onCompleted: ({ setView: { dataset, view: value } }) => { - router.history.location.state.state = { - ...router.history.location.state, - view: value, - viewCls: dataset.viewCls, - selected: [], - selectedLabels: [], - }; + if (router.history.location.state) { + router.history.location.state.state = { + ...router.history.location.state, + view: value, + viewCls: dataset.viewCls, + selected: [], + selectedLabels: [], + }; + } + updateState({ dataset: transformDataset(dataset), state: {