mirror of
https://github.com/sbender9/signalk-raymarine-autopilot.git
synced 2020-11-18 19:37:28 -08:00
fix: improved cleaning of notifications (#8)
This commit is contained in:
parent
a3d311161d
commit
fcbd729cdf
@ -391,6 +391,9 @@ var setNotificationMessage = function(value) {
|
||||
value.path = value.path.replace('notifications.', '');
|
||||
if (typeof value.value !== 'undefined') {
|
||||
if (value.value.state === 'normal') {
|
||||
if (bottomBarIconDiv.innerHTML === notificationsArray[value.path]) {
|
||||
bottomBarIconDiv.innerHTML = '';
|
||||
}
|
||||
delete notificationsArray[value.path]
|
||||
} else {
|
||||
notificationsArray[value.path] = value.value.message.replace('Pilot', '');
|
||||
@ -403,9 +406,14 @@ var setNotificationMessage = function(value) {
|
||||
if (alarmsCount > 0) {
|
||||
notificationCounterTextDiv.innerHTML = alarmsCount;
|
||||
notificationCounterDiv.style.visibility = 'visible';
|
||||
if (bottomBarIconDiv.innerHTML === '') {
|
||||
bottomBarIconDiv.innerHTML = Object.keys(notificationsArray)[0];
|
||||
}
|
||||
} else {
|
||||
notificationCounterTextDiv.innerHTML = '';
|
||||
notificationCounterDiv.style.visibility = 'hidden';
|
||||
bottomBarIconDiv.style.visibility = 'hidden';
|
||||
bottomBarIconDiv.innerHTML = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user