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