Skip to content

Commit

Permalink
Merge pull request #3078 from OpenNeuroOrg/subscription-cleanup
Browse files Browse the repository at this point in the history
chore(app): Cleanup unused GraphQL subscription hooks
  • Loading branch information
nellh authored Jun 12, 2024
2 parents ebb4e21 + 024646e commit 4e7fee9
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 302 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions packages/openneuro-app/src/scripts/dataset/dataset-query.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ import { Loading } from "@openneuro/components/loading"
import DatasetQueryContext from "../datalad/dataset/dataset-query-context.js"
import DatasetContext from "../datalad/dataset/dataset-context.js"
import DatasetRoutes from "./dataset-routes"
import FilesSubscription from "../datalad/subscriptions/files-subscription.jsx"
import usePermissionsSubscription from "../datalad/subscriptions/usePermissionsSubscription"
import useSnapshotsUpdatedSubscriptions from "../datalad/subscriptions/useSnapshotsUpdatedSubscriptions"
import useDatasetDeletedSubscription, {
datasetDeletedToast,
} from "../datalad/subscriptions/useDatasetDeletedSubscription.jsx"
import useDraftSubscription from "../datalad/subscriptions/useDraftSubscription.js"

import ErrorBoundary, {
ErrorBoundaryAssertionFailureException,
} from "../errors/errorBoundary.jsx"
Expand All @@ -41,15 +33,6 @@ export const DatasetQueryHook = ({ datasetId, draft }) => {
nextFetchPolicy: "cache-first",
},
)
usePermissionsSubscription([datasetId])
useSnapshotsUpdatedSubscriptions(datasetId)
useDatasetDeletedSubscription([datasetId], ({ data: subData }) => {
if (subData && subData.datasetDeleted === datasetId) {
navigate("/dashboard/datasets")
datasetDeletedToast(datasetId, data?.dataset?.draft?.description?.Name)
}
})
useDraftSubscription(datasetId)

if (error) {
if (error.message === "You do not have access to read this dataset.") {
Expand Down Expand Up @@ -94,7 +77,6 @@ export const DatasetQueryHook = ({ datasetId, draft }) => {
}}
>
<DatasetRoutes dataset={data.dataset} />
<FilesSubscription datasetId={datasetId} />
</DatasetQueryContext.Provider>
</ErrorBoundary>
</DatasetContext.Provider>
Expand Down

0 comments on commit 4e7fee9

Please sign in to comment.