File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
site/src/components/WorkspaceScheduleBanner Expand file tree Collapse file tree 1 file changed +2
-6
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
- }
28
+ }
32
29
const deadline = dayjs ( workspace . latest_build . deadline ) . utc ( )
33
30
const thirtyMinutesFromNow = dayjs ( ) . add ( 30 , "minutes" ) . utc ( )
34
31
return deadline . isSameOrBefore ( thirtyMinutesFromNow )
35
- }
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