@@ -180,7 +180,7 @@ interface ITimingWarningProps {
180
180
playlist : DBRundownPlaylist
181
181
inActiveRundownView ?: boolean
182
182
studioMode : boolean
183
- oneMinuteBeforeAction : ( e : Event ) => void
183
+ oneMinuteBeforeAction : ( e : Event , noResetOnActivate : boolean ) => void
184
184
}
185
185
186
186
interface ITimingWarningState {
@@ -233,12 +233,12 @@ const WarningDisplay = withTranslation()(
233
233
} )
234
234
}
235
235
236
- oneMinuteBeforeAction = ( e : any ) => {
236
+ oneMinuteBeforeAction = ( e : any , noResetOnActivate : boolean ) => {
237
237
this . setState ( {
238
238
plannedStartCloseShow : false ,
239
239
} )
240
240
241
- this . props . oneMinuteBeforeAction ( e )
241
+ this . props . oneMinuteBeforeAction ( e , noResetOnActivate )
242
242
}
243
243
244
244
render ( ) : JSX . Element | null {
@@ -249,9 +249,18 @@ const WarningDisplay = withTranslation()(
249
249
return (
250
250
< ModalDialog
251
251
title = { t ( 'Start time is close' ) }
252
- acceptText = { t ( 'Activate "On Air"' ) }
252
+ acceptText = { t ( 'Reset and Activate "On Air"' ) }
253
253
secondaryText = { t ( 'Cancel' ) }
254
- onAccept = { this . oneMinuteBeforeAction }
254
+ actions = { [
255
+ {
256
+ label : t ( 'Activate "On Air"' ) ,
257
+ classNames : 'btn-secondary' ,
258
+ on : ( e ) => {
259
+ this . oneMinuteBeforeAction ( e as Event , true ) // this one activates without resetting
260
+ } ,
261
+ } ,
262
+ ] }
263
+ onAccept = { ( e ) => this . oneMinuteBeforeAction ( e as Event , false ) }
255
264
onDiscard = { this . discard }
256
265
onSecondary = { this . discard }
257
266
show = {
@@ -263,7 +272,7 @@ const WarningDisplay = withTranslation()(
263
272
>
264
273
< p >
265
274
{ t (
266
- 'You are in rehearsal mode, the broadcast starts in less than 1 minute. Do you want to reset the rundown and go into On-Air mode?'
275
+ 'You are in rehearsal mode, the broadcast starts in less than 1 minute. Do you want to go into On-Air mode?'
267
276
) }
268
277
</ p >
269
278
</ ModalDialog >
@@ -1018,6 +1027,33 @@ const RundownHeader = withTranslation()(
1018
1027
}
1019
1028
}
1020
1029
1030
+ activateRundown = ( e : any ) => {
1031
+ // Called from the ModalDialog, 1 minute before broadcast starts
1032
+ if ( this . props . userPermissions . studio ) {
1033
+ const { t } = this . props
1034
+ this . rewindSegments ( ) // Do a rewind right away
1035
+
1036
+ doUserAction (
1037
+ t ,
1038
+ e ,
1039
+ UserAction . ACTIVATE_RUNDOWN_PLAYLIST ,
1040
+ ( e , ts ) => MeteorCall . userAction . activate ( e , ts , this . props . playlist . _id , false ) ,
1041
+ ( err ) => {
1042
+ if ( ! err ) {
1043
+ if ( typeof this . props . onActivate === 'function' ) this . props . onActivate ( false )
1044
+ } else if ( ClientAPI . isClientResponseError ( err ) ) {
1045
+ if ( err . error . key === UserErrorMessage . RundownAlreadyActiveNames ) {
1046
+ this . handleAnotherPlaylistActive ( this . props . playlist . _id , false , err . error , ( ) => {
1047
+ if ( typeof this . props . onActivate === 'function' ) this . props . onActivate ( false )
1048
+ } )
1049
+ return false
1050
+ }
1051
+ }
1052
+ }
1053
+ )
1054
+ }
1055
+ }
1056
+
1021
1057
resetAndActivateRundown = ( e : any ) => {
1022
1058
// Called from the ModalDialog, 1 minute before broadcast starts
1023
1059
if ( this . props . userPermissions . studio ) {
@@ -1148,7 +1184,9 @@ const RundownHeader = withTranslation()(
1148
1184
studioMode = { this . props . userPermissions . studio }
1149
1185
inActiveRundownView = { this . props . inActiveRundownView }
1150
1186
playlist = { this . props . playlist }
1151
- oneMinuteBeforeAction = { this . resetAndActivateRundown }
1187
+ oneMinuteBeforeAction = { ( e , noResetOnActivate ) =>
1188
+ noResetOnActivate ? this . activateRundown ( e ) : this . resetAndActivateRundown ( e )
1189
+ }
1152
1190
/>
1153
1191
< div className = "row flex-row first-row super-dark" >
1154
1192
< div className = "flex-col left horizontal-align-left" >
0 commit comments