Don't insert newlines with default Flux script

Co-authored-by: Chris Henn <chris.henn@influxdata.com>
Co-authored-by: Andrew Watkins <andrew.watkinz@gmail.com>
pull/10616/head
Christopher Henn 2018-06-06 12:01:46 -07:00
parent 9d2181fc1a
commit bee3a4aa3e
1 changed files with 8 additions and 1 deletions

View File

@ -268,8 +268,15 @@ export class FluxPage extends PureComponent<Props, State> {
private handleAppendFrom = (): void => {
const {script} = this.props
const newScript = `${script.trim()}\n\n${builder.NEW_FROM}\n\n`
let newScript = script.trim()
const from = builder.NEW_FROM
if (!newScript) {
this.getASTResponse(from)
return
}
newScript = `${script.trim()}\n\n${from}\n\n`
this.getASTResponse(newScript)
}