BUG: Fix for irelavant req that falls in cache range

This commit is contained in:
Ivymaster
2026-08-04 17:38:24 +02:00
parent 36a11ec2fd
commit 0df66047fe
2 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -1301,7 +1301,7 @@ export default {
:mode="currentMode"
:parkedEvents="parkedKeys"
:visible-lecturers="visibleLecturerUids"
:cacheMultiplier="currentMode === 'week' ? 0 : 0"
:cacheMultiplier="currentMode === 'week' ? 1 : 0"
@drop="dropHandler"
@resize="resizeHandler"
@update:date="handleChangeDate"
@@ -18,6 +18,12 @@ export function useEventLoader(
let currentlyDisplayedDateRange;
const getCachePadding = () => {
const cacheSize = Math.max(Vue.toValue(cacheMultiplier), 0);
return Math.round(currentlyDisplayedDateRange.length() * cacheSize) + 1;
};
const reload = () => {
if (
currentlyDisplayedDateRange &&
@@ -144,10 +150,7 @@ export function useEventLoader(
cachedEventsEndTimestamp = modifiedRequestEndTimestamp;
}
const cacheSize = Math.max(Vue.toValue(cacheMultiplier), 0);
const cachePadding = Math.round(
currentlyDisplayedDateRange.length() * cacheSize,
);
const cachePadding = getCachePadding();
allowedCacheStartTimestamp = startTimestamp - cachePadding;
allowedCacheEndTimestamp = endTimestamp + cachePadding;
@@ -190,11 +193,6 @@ export function useEventLoader(
allowedCacheStartTimestamp,
allowedCacheEndTimestamp,
) => {
const cacheSize = Math.max(Vue.toValue(cacheMultiplier), 0);
const cachePadding = Math.round(
currentlyDisplayedDateRange.length() * cacheSize,
);
if (
cachedEventsStartTimestamp < allowedCacheEndTimestamp &&
cachedEventsEndTimestamp > allowedCacheStartTimestamp