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) { decodeResponse (response) {
const headers = response.headers const headers = response.headers
const _charset = headers.has('content-type') ? const _charset = headers.has('content-type')
this.extractContentTypeCharset(headers.get('content-type')) : ? this.extractContentTypeCharset(headers.get('content-type'))
undefined : undefined
return response.arrayBuffer().then(buff => { return response.arrayBuffer().then(buff => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
try { try {
const charset = _charset !== undefined && const charset = _charset !== undefined &&
iconv.encodingExists(_charset) ? iconv.encodingExists(_charset)
_charset : ? _charset
'utf-8' : 'utf-8'
resolve(iconv.decode(new Buffer(buff), charset).toString()) resolve(iconv.decode(new Buffer(buff), charset).toString())
} catch (e) { } catch (e) {
reject(e) reject(e)