Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit e65f5c2

Browse files
committed
Merge pull request #1658 from OpenBazaar/libbitcoinOfflineWarning
Adds a warning to the status bar whenever libbitcoin is offline.
2 parents f520e92 + 852e530 commit e65f5c2

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

js/languages/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
"SSLIsOn": "SSL is on",
185185
"SSLIsOff": "SSL is off",
186186
"LibbitcoinServerAddress": "Libbitcoin Server Address",
187+
"LibbitcoinOfflineWarning":"The Libbitcoin Server is not responding. Transactions can still be made, but payments will not complete until Libbitcoin is back online.",
187188
"libbitcoinPlaceholder": "tcp://serveraddress:port or leave this field blank to use the default value (recommended)",
188189
"SMTPNotificationsWarning": "Turn email notifications on/off",
189190
"SMTPNotifications": "SMTP Notifications",

js/start.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ $(window).bind('hashchange', function(){
255255
localStorage.setItem('route', Backbone.history.getFragment());
256256
});
257257

258-
//set fancy styles class
258+
//set minimized effects styles class
259259
if (localStorage.getItem('minEffects') == "true"){
260260
$html.addClass('minEffects');
261261
}
@@ -627,5 +627,18 @@ app.getHeartbeatSocket().on('message', function(e) {
627627
}
628628
}
629629
}
630+
if (e.jsonData && e.jsonData.libbitcoin) {
631+
if (e.jsonData.libbitcoin != "online") {
632+
if (!this.libbitCoinStatus) {
633+
this.libbitCoinStatus = app.statusBar.pushMessage({
634+
type: 'warning',
635+
msg: '<i>' + window.polyglot.t('LibbitcoinOfflineWarning') + '</i>',
636+
duration: false
637+
});
638+
}
639+
} else {
640+
this.libbitCoinStatus && this.libbitCoinStatus.remove();
641+
}
642+
}
630643
});
631644
// end - server connection and app initialization flow

js/views/userPageVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ UserPageVw = pageVw.extend({
696696
this.following.fetch({
697697
data: self.userProfileFetchParameters,
698698
success: function(model){
699-
var followingArray = model.get('following');
699+
var followingArray = model.get('following') || [];
700700
if (self.isRemoved()) return;
701701

702702
if (self.options.ownPage === true){

0 commit comments

Comments
 (0)