refactored

This commit is contained in:
Rares Mardare 2022-10-05 12:19:46 +03:00
parent 0018fb1973
commit 79b2831abc

View file

@ -316,9 +316,7 @@ function getColorSchemeMappingForUsers(store: RootStore, scheduleId: string): {
const startMoment = getStartOfWeek(store.currentTimezone);
const shifts = getShiftsFromStore(store, scheduleId, startMoment, false);
const layers = getLayersFromStore(store, scheduleId, startMoment);
const overrides = getOverridesFromStore(store, scheduleId, startMoment, false);
const usersColorSchemeHash: { [userId: string]: Set<string> } = {};
@ -327,8 +325,10 @@ function getColorSchemeMappingForUsers(store: RootStore, scheduleId: string): {
return usersColorSchemeHash;
}
shifts.forEach(({ shiftId, events }) => populateUserHashSet(events, shiftId, false));
shifts.forEach(({ events }, rotationIndex) => populateUserHashSet(events, rotationIndex, true));
shifts.forEach(({ shiftId, events }, rotationIndex) => {
populateUserHashSet(events, shiftId, false);
populateUserHashSet(events, rotationIndex, true);
});
return usersColorSchemeHash;