1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Fixing indentations

This commit is contained in:
Guilherme Silva
2018-11-08 14:03:21 +00:00
parent 441c70b388
commit a46c519459

View File

@@ -786,16 +786,16 @@ export default class CodeEditor extends React.Component {
decodeResponse (response) {
const headers = response.headers
const _charset = headers.has('content-type') ?
this.extractContentTypeCharset(headers.get('content-type')) :
undefined
const _charset = headers.has('content-type')
? this.extractContentTypeCharset(headers.get('content-type'))
: undefined
return response.arrayBuffer().then(buff => {
return new Promise((resolve, reject) => {
try {
const charset = _charset !== undefined &&
iconv.encodingExists(_charset) ?
_charset :
'utf-8'
iconv.encodingExists(_charset)
? _charset
: 'utf-8'
resolve(iconv.decode(new Buffer(buff), charset).toString())
} catch (e) {
reject(e)