Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Offline message without connection established #1156
Browse files Browse the repository at this point in the history
Offline message now correctly display in case when user refreshes the page again without connection established
  • Loading branch information
wiadev committed Sep 8, 2017
1 parent f330321 commit ac2d2ac
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/components/app/ErrorScreen.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import React, { Component } from 'react';
import counterpart from 'counterpart';

const OFFLINE_MESSAGE_LINE1 = 'Connection lost.';
const OFFLINE_MESSAGE_LINE2 = 'There are some connection issues. ' +
'Check connection and try to refresh the page.';

class ErrorScreen extends Component {
constructor(props) {
super(props);
}
render() {
let line1 = counterpart.translate('window.error.noStatus.title');
let line2 = counterpart.translate('window.error.noStatus.description');

if (!line1) {
line1 = OFFLINE_MESSAGE_LINE1;
}

if (!line2) {
line2 = OFFLINE_MESSAGE_LINE2;
}

return (
<div className="screen-freeze">
<h3>{counterpart.translate('window.error.noStatus.title')}</h3>
<h3>{line1}</h3>
<p>
{counterpart.translate('window.error.noStatus.description')}
{line2}
</p>
</div>
)
Expand Down

0 comments on commit ac2d2ac

Please sign in to comment.