mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-28 17:25:10 +03:00
Fix firefox recoil snapshot bug (#2321)
fix firefox recoil snapshot bug
This commit is contained in:
parent
9725582a82
commit
f19ed5e2e4
@ -1,5 +1,4 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useRecoilSnapshot, useRecoilValue } from 'recoil';
|
||||
import { useRecoilTransactionObserver_UNSTABLE, useRecoilValue } from 'recoil';
|
||||
|
||||
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
|
||||
import { logDebug } from '~/utils/logDebug';
|
||||
@ -16,15 +15,12 @@ const formatTitle = (stateName: string) => {
|
||||
};
|
||||
|
||||
export const RecoilDebugObserverEffect = () => {
|
||||
const snapshot = useRecoilSnapshot();
|
||||
|
||||
const isDebugMode = useRecoilValue(isDebugModeState);
|
||||
|
||||
useEffect(() => {
|
||||
useRecoilTransactionObserver_UNSTABLE(({ snapshot }) => {
|
||||
if (!isDebugMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const node of Array.from(
|
||||
snapshot.getNodes_UNSTABLE({ isModified: true }),
|
||||
)) {
|
||||
@ -40,7 +36,6 @@ export const RecoilDebugObserverEffect = () => {
|
||||
|
||||
console.groupEnd();
|
||||
}
|
||||
}, [isDebugMode, snapshot]);
|
||||
|
||||
});
|
||||
return null;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user