File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/cycles/(list) Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -98,4 +98,4 @@ const ProjectCyclesPage = observer(() => {
98
98
) ;
99
99
} ) ;
100
100
101
- export default ProjectCyclesPage ;
101
+ export default ProjectCyclesPage ;
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
3
import React , { useEffect , useState } from "react" ;
4
+ import { mutate } from "swr" ;
4
5
// types
5
6
import type { CycleDateCheckData , ICycle , TCycleTabOptions } from "@plane/types" ;
6
7
// ui
@@ -43,6 +44,16 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
43
44
const selectedProjectId = payload . project_id ?? projectId . toString ( ) ;
44
45
await createCycle ( workspaceSlug , selectedProjectId , payload )
45
46
. then ( ( res ) => {
47
+ // mutate when the current cycle creation is active
48
+ if ( payload . start_date && payload . end_date ) {
49
+ const currentDate = new Date ( ) ;
50
+ const cycleStartDate = new Date ( payload . start_date ) ;
51
+ const cycleEndDate = new Date ( payload . end_date ) ;
52
+ if ( currentDate >= cycleStartDate && currentDate <= cycleEndDate ) {
53
+ mutate ( `PROJECT_ACTIVE_CYCLE_${ selectedProjectId } ` ) ;
54
+ }
55
+ }
56
+
46
57
setToast ( {
47
58
type : TOAST_TYPE . SUCCESS ,
48
59
title : "Success!" ,
You can’t perform that action at this time.
0 commit comments