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
12 lines
324 B
TypeScript
12 lines
324 B
TypeScript
import { createState } from 'twenty-ui';
|
|
import { localStorageEffect } from '~/utils/recoil-effects';
|
|
|
|
export const lastVisitedViewPerObjectMetadataItemState = createState<Record<
|
|
string,
|
|
string
|
|
> | null>({
|
|
key: 'lastVisitedViewPerObjectMetadataItemState',
|
|
defaultValue: null,
|
|
effects: [localStorageEffect()],
|
|
});
|