diff --git a/components/ConversionPanel.js b/components/ConversionPanel.js index 2c9a84a..408e572 100644 --- a/components/ConversionPanel.js +++ b/components/ConversionPanel.js @@ -97,9 +97,16 @@ export default class ConversionPanel extends PureComponent { fetchJSON = async () => { const url = window.prompt('Enter URL to fetch JSON from a remote server.') if (!url) return - const res = await unfetch(url) - const json = await res.json() - this.onChange(JSON.stringify(json, null, 2)) + try { + const res = await unfetch(url) + const json = await res.json() + this.onChange(JSON.stringify(json, null, 2)) + } catch (e) { + this.setState({ + info: e.message, + infoType: "error" + }); + } } onChange = async (newValue, leftSplitValue) => { @@ -190,8 +197,7 @@ export default class ConversionPanel extends PureComponent { const codeMirrorOptions = { lineNumbers: true, theme: "chrome-devtools", - lineWrapping: true, - scrollbarStyle: null + lineWrapping: true }; return ( diff --git a/package.json b/package.json index 75b3ccf..037043f 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,8 @@ "stringify-object": "^3.2.0", "transform-css-to-js": "^0.1.1", "transform-graphql-type-annotations": "^0.1.1", + "transform-json-types": "^0.2.3", "transform-svg-to-native": "^0.1.1", - "transform-json-types": "^0.2.2", "unfetch": "^3.0.0", "xml-js": "^1.4.1" }, diff --git a/static/styles.css b/static/styles.css index 6ed30fb..a643862 100644 --- a/static/styles.css +++ b/static/styles.css @@ -207,6 +207,7 @@ height: 300px; color: black; direction: ltr; + overflow: hidden; } /* PADDING */ diff --git a/yarn.lock b/yarn.lock index 974d228..a6fe821 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5414,9 +5414,9 @@ transform-graphql-type-annotations@^0.1.1: apollo-codegen "0.17.0-alpha.1" graphql "^0.10.5" -transform-json-types@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/transform-json-types/-/transform-json-types-0.2.2.tgz#c1f9e2fc827522edbaa6f2b92f689c91b3a35ad7" +transform-json-types@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/transform-json-types/-/transform-json-types-0.2.3.tgz#04b68084033cd5511c06007cf4c66019868d1321" dependencies: lodash "^4.17.4" sha1 "^1.1.1"