mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
prevent loading users calendar multiple times when adding multiple users
This commit is contained in:
parent
00ef58301e
commit
d32a69a657
@ -10,6 +10,8 @@ import {
|
||||
} from './../api';
|
||||
import {datetimeToISO} from 'ChillMainAssets/chill/js/date';
|
||||
|
||||
const fetchings = new Set();
|
||||
|
||||
export default {
|
||||
setCurrentDatesView({ commit, dispatch }, {start, end}) {
|
||||
commit('setCurrentDatesView', {start, end});
|
||||
@ -23,6 +25,15 @@ export default {
|
||||
|
||||
let promises = [];
|
||||
for (const uid of state.currentView.users.keys()) {
|
||||
let unique = `${uid}, ${state.currentView.start.toISOString()}, ${state.currentView.end.toISOString()}`;
|
||||
|
||||
if (fetchings.has(unique)) {
|
||||
console.log('prevent from fetching for a user', unique);
|
||||
continue;
|
||||
}
|
||||
|
||||
fetchings.add(unique);
|
||||
|
||||
promises.push(
|
||||
dispatch(
|
||||
'fetchCalendarRangeForUser',
|
||||
|
Loading…
x
Reference in New Issue
Block a user