File tree 1 file changed +4
-8
lines changed
site/src/components/WorkspaceScheduleBanner
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,12 @@ export interface WorkspaceScheduleBannerProps {
23
23
}
24
24
25
25
export const shouldDisplay = ( workspace : TypesGen . Workspace ) : boolean => {
26
- if ( ! isWorkspaceOn ( workspace ) ) {
26
+ if ( ! isWorkspaceOn ( workspace ) || ! workspace . latest_build . deadline ) {
27
27
return false
28
- } else {
29
- if ( ! workspace . latest_build . deadline ) {
30
- return false
31
- }
32
- const deadline = dayjs ( workspace . latest_build . deadline ) . utc ( )
33
- const thirtyMinutesFromNow = dayjs ( ) . add ( 30 , "minutes" ) . utc ( )
34
- return deadline . isSameOrBefore ( thirtyMinutesFromNow )
35
28
}
29
+ const deadline = dayjs ( workspace . latest_build . deadline ) . utc ( )
30
+ const thirtyMinutesFromNow = dayjs ( ) . add ( 30 , "minutes" ) . utc ( )
31
+ return deadline . isSameOrBefore ( thirtyMinutesFromNow )
36
32
}
37
33
38
34
export const WorkspaceScheduleBanner : FC < React . PropsWithChildren < WorkspaceScheduleBannerProps > > = ( {
You can’t perform that action at this time.
0 commit comments