Open validated URL of loading error in the default browser

This commit is contained in:
Yuya Ochiai
2017-10-27 23:17:08 +09:00
parent 616465748b
commit 04f5d0340c

View File

@@ -3,6 +3,7 @@
const React = require('react');
const PropTypes = require('prop-types');
const {Grid, Row, Col} = require('react-bootstrap');
const {shell} = require('electron');
function ErrorView(props) {
const classNames = ['container', 'ErrorView'];
@@ -12,6 +13,10 @@ function ErrorView(props) {
if (props.withTab) {
classNames.push('ErrorView-with-tab');
}
function handleClick(event) {
event.preventDefault();
shell.openExternal(props.errorInfo.validatedURL);
}
return (
<Grid
id={props.id}
@@ -39,11 +44,17 @@ function ErrorView(props) {
<ul className='ErrorView-bullets' >
<li>{'Your computer is connected to the internet.'}</li>
<li>{'The Mattermost URL '}
<a href={props.errorInfo.validatedURL}>
<a
onClick={handleClick}
href={props.errorInfo.validatedURL}
>
{props.errorInfo.validatedURL}
</a>{' is correct.'}</li>
<li>{'You can reach '}
<a href={props.errorInfo.validatedURL}>
<a
onClick={handleClick}
href={props.errorInfo.validatedURL}
>
{props.errorInfo.validatedURL}
</a>{' from a browser window.'}</li>
</ul>