@@ -7,14 +7,14 @@ export function usePreparationDirty(dirty: boolean, visible = true) {
|
||||
useEffect(() => {
|
||||
const form = ref.current;
|
||||
if (!form) return;
|
||||
markPreparationDirty(form, visible && dirty);
|
||||
markPreparationDirty(form, visible && dirty, true);
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('sgc:context-dirty', {
|
||||
detail: { form, dirty: visible && dirty },
|
||||
}),
|
||||
);
|
||||
return () => {
|
||||
markPreparationDirty(form, false);
|
||||
markPreparationDirty(form, false, true);
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('sgc:context-dirty', {
|
||||
detail: { form, dirty: false },
|
||||
|
||||
Reference in New Issue
Block a user