Browse Source

online/offline detection

v0.25
pbca26 7 years ago
parent
commit
0eae44a739
  1. 2
      react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js
  2. 7
      react/src/components/dashboard/navbar/navbar.render.js
  3. 12
      react/src/components/dashboard/navbar/navbar.scss
  4. 4
      react/src/components/dashboard/sendCoin/sendCoin.render.js
  5. 2
      react/src/translate/en.js

2
react/src/components/dashboard/claimInterestModal/claimInterestModal.render.js

@ -118,7 +118,7 @@ export const _ClaimInterestTableRender = function() {
{ this.addressDropdownRender() }
</div>
}
{ !this.isFullySynced() &&
{ (!this.isFullySynced() || !navigator.onLine) &&
this.props.ActiveCoin &&
this.props.ActiveCoin.mode === 'native' &&
<div className="col-lg-12 padding-top-5 padding-bottom-35 send-coin-sync-warning">

7
react/src/components/dashboard/navbar/navbar.render.js

@ -80,6 +80,13 @@ const NavbarRender = function() {
<i className="site-menu-icon"></i> Explorer
</a>
</li>*/ }
{ !navigator.onLine &&
<li
className="nav-top-menu offline"
title={ translate('INDEX.WALLET_OFFLINE') }>
<span className="offline-icon"></span> { translate('INDEX.OFFLINE') }
</li>
}
</ul>
<ul className="nav navbar-toolbar navbar-right navbar-toolbar-right">
<li>

12
react/src/components/dashboard/navbar/navbar.scss

@ -17,6 +17,18 @@
}
}
}
.offline {
margin-top: 22px;
.offline-icon {
display: inline-block;
width: 10px;
height: 10px;
background: #f96868;
border-radius: 50%;
margin-left: 20px;
}
}
}
.navbar-nav > li > a.navbar-avatar,

4
react/src/components/dashboard/sendCoin/sendCoin.render.js

@ -124,7 +124,7 @@ export const _SendFormRender = function() {
{ this.props.ActiveCoin.coin }
</span>
</div>
{ !this.isFullySynced() &&
{ (!this.isFullySynced() || !navigator.onLine) &&
this.props.ActiveCoin &&
this.props.ActiveCoin.mode === 'native' &&
<div className="col-lg-12 padding-top-20 padding-bottom-20 send-coin-sync-warning">
@ -349,6 +349,8 @@ export const SendRender = function() {
</div>
<div>{ this.state.lastSendToResponse.result }</div>
{ this.props.ActiveCoin.mode === 'spv' &&
this.state.lastSendToResponse.raw &&
this.state.lastSendToResponse.raw.txid &&
<div>{ this.state.lastSendToResponse.raw.txid.replace(/\[.*\]/, '') }</div>
}
</div>

2
react/src/translate/en.js

@ -96,6 +96,8 @@ export const LANG_EN = {
'NO_ACTIVE_COIN': 'No active coin',
},
'INDEX': {
'WALLET_OFFLINE': 'Agama is currently unable to connect to the Internet.',
'OFFLINE': 'Offline',
'TOGGLE_COIN_CONTEXT_MENU': 'Toggle coin context menu',
'TOP_MENU': 'Top menu',
'ERROR_READING': 'Error reading',

Loading…
Cancel
Save