Simplify last visited (#10259)
In this PR, I'm simplifying the lastVisitedView / Object logic: - removing fallback logic as it's not useful - splitting hooks into smaller hooks (to avoir re-renders) - removing componentState on those states that are global
This commit is contained in:
@ -1,10 +1,7 @@
|
||||
import { createComponentState } from '@/ui/utilities/state/component-state/utils/createComponentState';
|
||||
import { createState } from 'twenty-ui';
|
||||
import { localStorageEffect } from '~/utils/recoil-effects';
|
||||
|
||||
export const lastVisitedObjectMetadataItemIdState = createComponentState<Record<
|
||||
string,
|
||||
string
|
||||
> | null>({
|
||||
export const lastVisitedObjectMetadataItemIdState = createState<string | null>({
|
||||
key: 'lastVisitedObjectMetadataItemIdState',
|
||||
defaultValue: null,
|
||||
effects: [localStorageEffect()],
|
||||
|
||||
Reference in New Issue
Block a user