fixed save button timestamp
This commit is contained in:
parent
f5f9d3d6fc
commit
5ef21543b3
@ -332,6 +332,18 @@ const ConstructorPage = ({ mode = 'constructor' }: ConstructorPageProps) => {
|
||||
[activePageId, pages],
|
||||
);
|
||||
|
||||
// Last project-level save: most recent updatedAt across all pages
|
||||
const lastProjectSaveAt = useMemo(() => {
|
||||
if (!pages.length) return null;
|
||||
return pages.reduce((latest, page) => {
|
||||
if (!page.updatedAt) return latest;
|
||||
if (!latest) return page.updatedAt;
|
||||
return new Date(page.updatedAt) > new Date(latest)
|
||||
? page.updatedAt
|
||||
: latest;
|
||||
}, null as string | null);
|
||||
}, [pages]);
|
||||
|
||||
// Transition preview state management
|
||||
const {
|
||||
preview: transitionPreview,
|
||||
@ -1723,7 +1735,7 @@ const ConstructorPage = ({ mode = 'constructor' }: ConstructorPageProps) => {
|
||||
: '/projects/projects-list',
|
||||
)
|
||||
}
|
||||
lastSavedAt={activePage?.updatedAt}
|
||||
lastSavedAt={lastProjectSaveAt}
|
||||
lastSavedToStageAt={lastSavedToStage}
|
||||
/>
|
||||
)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user