@@ -13,11 +13,14 @@ import {
1313 Panel ,
1414} from '@influxdata/clockface'
1515import React , { useState , FC , useCallback , useEffect , useRef } from 'react'
16- import { useSelector } from 'react-redux'
16+ import { useDispatch , useSelector } from 'react-redux'
1717import { useHistory , useLocation } from 'react-router-dom'
1818import { getOrg } from 'src/organizations/selectors'
1919import { getOrg as fetchOrg } from 'src/organizations/apis'
2020
21+ // Actions
22+ import { setCurrentPage } from 'src/shared/reducers/currentPage'
23+
2124// Utils
2225import { buildDeepLinkingMap } from 'src/utils/deepLinks'
2326import { event } from 'src/cloud/utils/reporting'
@@ -135,6 +138,8 @@ const NotFound: FC = () => {
135138 const location = useLocation ( )
136139 const history = useHistory ( )
137140 const reduxOrg = useSelector ( getOrg )
141+ const dispatch = useDispatch ( )
142+
138143 const org = useRef < Organization > ( reduxOrg )
139144
140145 const handleDeepLink = useCallback ( async ( ) => {
@@ -169,6 +174,13 @@ const NotFound: FC = () => {
169174 }
170175 } , [ handleDeepLink ] )
171176
177+ useEffect ( ( ) => {
178+ dispatch ( setCurrentPage ( 'not found' ) )
179+ return ( ) => {
180+ dispatch ( setCurrentPage ( 'not set' ) )
181+ }
182+ } , [ dispatch ] )
183+
172184 if ( isFetchingOrg ) {
173185 // don't render anything if this component is actively fetching org id
174186 // this prevents popping in a 404 page then redirecting
0 commit comments