@@ -29,9 +29,9 @@ const SaveAndExecuteButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...p
2929 title = { inlineButtons ? __ ( 'Save Snippet and Execute Once' , 'code-snippets' ) : undefined }
3030 { ...props }
3131 >
32- { inlineButtons ?
33- __ ( 'Execute Once' , 'code-snippets' ) :
34- __ ( 'Save Changes and Execute Once' , 'code-snippets' ) }
32+ { inlineButtons
33+ ? __ ( 'Execute Once' , 'code-snippets' )
34+ : __ ( 'Save Changes and Execute Once' , 'code-snippets' ) }
3535 </ Button >
3636
3737const DeactivateButton : React . FC < SubmitButtonProps > = ( { inlineButtons, ...props } ) =>
@@ -40,9 +40,9 @@ const DeactivateButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...props
4040 title = { inlineButtons ? __ ( 'Save Snippet and Deactivate' , 'code-snippets' ) : undefined }
4141 { ...props }
4242 >
43- { inlineButtons ?
44- __ ( 'Deactivate' , 'code-snippets' ) :
45- __ ( 'Save Changes and Deactivate' , 'code-snippets' ) }
43+ { inlineButtons
44+ ? __ ( 'Deactivate' , 'code-snippets' )
45+ : __ ( 'Save Changes and Deactivate' , 'code-snippets' ) }
4646 </ Button >
4747
4848const ActivateButton : React . FC < SubmitButtonProps > = ( { inlineButtons, ...props } ) =>
@@ -51,9 +51,9 @@ const ActivateButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...props }
5151 title = { inlineButtons ? __ ( 'Save Snippet and Activate' , 'code-snippets' ) : undefined }
5252 { ...props }
5353 >
54- { inlineButtons ?
55- __ ( 'Activate' , 'code-snippets' ) :
56- __ ( 'Save Changes and Activate' , 'code-snippets' ) }
54+ { inlineButtons
55+ ? __ ( 'Activate' , 'code-snippets' )
56+ : __ ( 'Save Changes and Activate' , 'code-snippets' ) }
5757 </ Button >
5858
5959interface ActivateOrDeactivateButtonProps {
@@ -111,9 +111,11 @@ const validateSnippet = (snippet: Snippet): undefined | string => {
111111}
112112
113113const shouldActivateByDefault = ( snippet : Snippet , inlineButtons ?: boolean ) : boolean =>
114- ! inlineButtons && ! ! window . CODE_SNIPPETS_EDIT ?. activateByDefault &&
115- ! snippet . active && 'single-use' !== snippet . scope &&
116- ( ! snippet . shared_network || ! isNetworkAdmin ( ) )
114+ ! inlineButtons
115+ && ! ! window . CODE_SNIPPETS_EDIT ?. activateByDefault
116+ && ! snippet . active
117+ && 'single-use' !== snippet . scope
118+ && ( ! snippet . shared_network || ! isNetworkAdmin ( ) )
117119
118120interface SubmitConfirmDialogProps {
119121 isOpen : boolean
@@ -159,8 +161,8 @@ export const SubmitButton: React.FC<SubmitButtonsProps> = ({ inlineButtons }) =>
159161 }
160162
161163 return < >
162- { activateByDefault ? null :
163- < SaveChangesButton
164+ { activateByDefault ? null
165+ : < SaveChangesButton
164166 primary = { ! inlineButtons }
165167 onClick = { ( ) => handleSubmit ( submitSnippet ) }
166168 disabled = { isWorking }
@@ -176,8 +178,8 @@ export const SubmitButton: React.FC<SubmitButtonsProps> = ({ inlineButtons }) =>
176178 onDeactivate = { ( ) => handleSubmit ( submitAndDeactivateSnippet ) }
177179 />
178180
179- { activateByDefault ?
180- < SaveChangesButton
181+ { activateByDefault
182+ ? < SaveChangesButton
181183 onClick = { ( ) => handleSubmit ( submitSnippet ) }
182184 disabled = { isWorking }
183185 inlineButtons = { inlineButtons }
0 commit comments