Skip to content
Snippets Groups Projects
Verified Commit 5ed339c7 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

[web] fix two things in the mytoken list notification management

parent bdcd0832
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
<h5>Notifications</h5>
{{>notifications/info-content-notifications}}
</div>
<div class="col alert border mx-3">
<div class="col alert border mx-3" id="notifications-calendarinfo-alert">
{{>notifications/info-content-calendars}}
</div>
</div>
......
......@@ -43,10 +43,7 @@ function listNotifications(...next) {
$('[data-toggle="tooltip"]').tooltip();
doNext(...next);
},
error: function (errRes) {
$errorModalMsg.text(getErrorMessage(errRes));
$errorModal.modal();
},
error: standardErrorHandler,
});
}
......@@ -343,10 +340,7 @@ function deleteNotification() {
success: function () {
listNotifications();
},
error: function (errRes) {
$errorModalMsg.text(getErrorMessage(errRes));
$errorModal.modal();
}
error: standardErrorHandler
});
}
......@@ -372,10 +366,7 @@ function removeTokenFromNotificationFromMangement(mom_id) {
$('#notifications-msg').find(`tr[management-code=${mc}] td[role=button]`)[0].click();
});
},
error: function (errRes) {
$errorModalMsg.text(getErrorMessage(errRes));
$errorModal.modal();
}
error: standardErrorHandler
});
}
......@@ -511,9 +502,9 @@ function fillNotificationAndCalendarInfo(cals, notifications, $container, prefix
let notificationsSet = notifications !== undefined && notifications.length > 0;
if (!calsSet && !notificationsSet) {
$container.hideB();
return;
} else {
$container.showB();
}
$container.showB();
fillCalendarInfo(cals, calsSet, prefix);
fillNotificationInfo(notifications, notificationsSet, prefix);
}
......@@ -526,12 +517,12 @@ function notificationModal(doesExpire) {
let nots = momIDNotificationsMap[id] || [];
let user_nots = momIDNotificationsMap["user"] || [];
nots = nots.concat(user_nots);
$tokeninfoCalendarListing(notificationPrefix).showB();
fillNotificationAndCalendarInfo(cals, nots, $(prefixId("not-info-body", notificationPrefix)), notificationPrefix);
if (!doesExpire) {
$tokeninfoCalendarListing(notificationPrefix).hideB();
$('#notifications-calendarinfo-alert').hideB();
} else {
$('#notifications-calendarinfo-alert').showB();
notificationModalInitSubscribeCalendars(cals);
notificationModalInitEntryInvite();
}
......@@ -709,7 +700,7 @@ $('#sent-calendar-add').on('click', function () {
success: function () {
getCalendars(function () {
let cals = momIDCalendarsMap[momID];
fillCalendarInfo(cals, true, notificationPrefix);
fillCalendarInfo(cals, cals !== undefined && cals.length > 0, notificationPrefix);
notificationModalInitSubscribeCalendars(cals);
});
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment