File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed
Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ export default class Topbar extends React.Component {
155155 Accept : "application/json"
156156 } )
157157 } )
158- . then ( res => handleResponse ( res ) )
158+ . then ( res => this . handleResponse ( res , { type } ) )
159159 }
160160
161161 if ( type === "client" ) {
@@ -165,21 +165,20 @@ export default class Topbar extends React.Component {
165165 spec : specSelectors . specJson ( )
166166 } )
167167 } )
168- . then ( res => handleResponse ( res ) )
168+ . then ( res => this . handleResponse ( res , { type } ) )
169169 }
170+ }
170171
171- function handleResponse ( res ) {
172- if ( ! res . ok ) {
173- return console . error ( res )
174- }
175-
176- fetch ( res . body . link )
177- . then ( res => res . blob ( ) )
178- . then ( res => {
179- this . downloadFile ( res , `${ name } -${ type } -generated.zip` )
180- } )
172+ handleResponse = ( res , { type } ) => {
173+ if ( ! res . ok ) {
174+ return console . error ( res )
181175 }
182176
177+ fetch ( res . body . link )
178+ . then ( res => res . blob ( ) )
179+ . then ( res => {
180+ this . downloadFile ( res , `${ name } -${ type } -generated.zip` )
181+ } )
183182 }
184183
185184 clearEditor = ( ) => {
@@ -308,4 +307,4 @@ Topbar.propTypes = {
308307 errSelectors : PropTypes . object . isRequired ,
309308 specActions : PropTypes . object . isRequired ,
310309 getComponent : PropTypes . func . isRequired
311- }
310+ }
You can’t perform that action at this time.
0 commit comments