Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions admin/src/components/Scheduler/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ const Scheduler = () => {
const [scheduler, setScheduler] = useState<IScheduler | undefined | null>(undefined);

const publishAt = useMemo(() => {
const newDate = modifiedData?.publishAt ?? initialData.publishAt;
const newDate = modifiedData?.publishAt;
return newDate ? new Date(newDate) : null;
}, [initialData.publishAt, modifiedData.publishAt]);
Copy link

Copilot AI May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency array for this useMemo still includes 'initialData.publishAt', but since the fallback has been removed, it may be clearer to remove 'initialData.publishAt' from the dependencies to avoid any confusion.

Suggested change
}, [initialData.publishAt, modifiedData.publishAt]);
}, [modifiedData.publishAt]);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goeie tip wel


const archiveAt = useMemo(() => {
const newDate = modifiedData?.archiveAt ?? initialData.archiveAt;

const newDate = modifiedData?.archiveAt
return newDate ? new Date(newDate) : null;
}, [initialData.archiveAt, modifiedData.archiveAt]);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@webbio/strapi-plugin-scheduler",
"private": false,
"version": "1.0.8",
"version": "1.1.0",
"description": "A plugin to publish or depublish content types in the future.",
"scripts": {
"develop": "tsc -p tsconfig.server.json -w",
Expand Down