Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Color for sync status, less scary message
Browse files Browse the repository at this point in the history
  • Loading branch information
aviraldg committed Mar 16, 2016
1 parent 47c3419 commit b47ea1c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,16 +902,21 @@ module.exports = React.createClass({
// This needs to be in in a try block as it will throw
// if there are more than 100 badge count changes in
// its internal queue
this.favicon.badge(notifCount);
var bgColor = "#0d0",
notif = notifCount;

if(state === "ERROR") {
notif = notif || "×";
bgColor = "#d00";
}

this.favicon.badge(notif, {
bgColor: bgColor
});
} catch (e) {
console.warn("Failed to set badge count: "+e.message);
}
document.title = "Vector"+(notifCount > 0 ? " ["+notifCount+"]" : "");

if(state === "ERROR") {
this.favicon.badge("×");
document.title = "Vector [ERROR]";
}
document.title = `Vector ${state === "ERROR" ? " [offline]" : ""}${notifCount > 0 ? ` [${notifCount}]` : ""}`;
},

onUserSettingsClose: function() {
Expand Down

0 comments on commit b47ea1c

Please sign in to comment.