Skip to content

Commit 069ada1

Browse files
rajat1saxenaRajat
andauthored
Reverted the update logic (#672)
Co-authored-by: Rajat <hi@rajatsaxena.dev>
1 parent e1a3c61 commit 069ada1

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

  • apps/web/components/admin/page-editor

apps/web/components/admin/page-editor/index.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,10 @@ export default function PageEditor({
167167
}
168168

169169
useEffect(() => {
170-
if (!page.pageId) {
171-
return;
172-
}
173-
const referenceLayout = page.draftLayout ?? page.layout;
174-
if (!referenceLayout) {
175-
return;
176-
}
177-
if (JSON.stringify(layout) !== JSON.stringify(referenceLayout)) {
170+
if (JSON.stringify(layout) !== JSON.stringify(page.draftLayout)) {
178171
debouncedSave(page.pageId, layout);
179172
}
180-
}, [layout, page.pageId, page.draftLayout, page.layout, debouncedSave]);
173+
}, [layout]);
181174

182175
useEffect(() => {
183176
if (draftTypefaces.length) {

0 commit comments

Comments
 (0)