Fix missing calendars for newly created or joined teams

pull/1/head
yflory 4 years ago
parent 82d71f6cc8
commit d11ba24c1e

@ -686,8 +686,8 @@ Messages.calendar_noNotification = "None";
var filter = function (teamId) { var filter = function (teamId) {
return Object.keys(APP.calendars || {}).filter(function (id) { return Object.keys(APP.calendars || {}).filter(function (id) {
var cal = APP.calendars[id] || {}; var cal = APP.calendars[id] || {};
var teams = cal.teams || []; var teams = (cal.teams || []).map(function (tId) { return Number(tId); });
return teams.indexOf(typeof(teamId) !== "undefined" ? teamId : 1) !== -1; return teams.indexOf(typeof(teamId) !== "undefined" ? Number(teamId) : 1) !== -1;
}); });
}; };
var tempCalendars = filter(0); var tempCalendars = filter(0);

Loading…
Cancel
Save