Make api name editable and add expiry (#6473)

Fixes #6302

---------

Co-authored-by: martmull <martmull@hotmail.fr>
This commit is contained in:
Prateek Jain
2024-08-02 17:01:06 +05:30
committed by GitHub
parent 68120d529c
commit 281bf689fa
13 changed files with 155 additions and 78 deletions

View File

@ -19,6 +19,7 @@ import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
import { usePageChangeEffectNavigateLocation } from '~/hooks/usePageChangeEffectNavigateLocation';
import { isDefined } from '~/utils/isDefined';
import { useCleanRecoilState } from '~/hooks/useCleanRecoilState';
// TODO: break down into smaller functions and / or hooks
// - moved usePageChangeEffectNavigateLocation into dedicated hook
@ -35,6 +36,8 @@ export const PageChangeEffect = () => {
const pageChangeEffectNavigateLocation =
usePageChangeEffectNavigateLocation();
const { cleanRecoilState } = useCleanRecoilState();
const eventTracker = useEventTracker();
const { addToCommandMenu, setToInitialCommandMenu } = useCommandMenu();
@ -43,6 +46,10 @@ export const PageChangeEffect = () => {
activityObjectNameSingular: CoreObjectNameSingular.Task,
});
useEffect(() => {
cleanRecoilState();
}, [cleanRecoilState]);
useEffect(() => {
if (!previousLocation || previousLocation !== location.pathname) {
setPreviousLocation(location.pathname);