File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -990,10 +990,12 @@ export default {
990
990
return ;
991
991
}
992
992
window .dispatchEvent (new CustomEvent (' set-custom-area-indicator-loading' , { detail: true }));
993
-
993
+ const options = {
994
+ currentTimeIndex: this .currentTimeIndex ,
995
+ };
994
996
try {
995
997
const custom = await fetchCustomAreaObjects (
996
- {} ,
998
+ options ,
997
999
this .drawnArea .area ,
998
1000
this .mergedConfigsData [0 ],
999
1001
this .indicator ,
Original file line number Diff line number Diff line change @@ -390,7 +390,10 @@ export const fetchCustomAreaObjects = async (
390
390
// TODO: Sending more requests overloads server, need to think how to handle this
391
391
let requestTimes = indicator . time ;
392
392
if ( indicator . time . length > 365 ) {
393
- requestTimes = indicator . time . slice ( - 365 ) ;
393
+ if ( options . currentTimeIndex ) {
394
+ const startIndex = Math . max ( 0 , options . currentTimeIndex - 365 ) ;
395
+ requestTimes = indicator . time . slice ( startIndex , options . currentTimeIndex ) ;
396
+ }
394
397
}
395
398
requestTimes . forEach ( ( entry ) => {
396
399
const requestUrl = `${ url } ?url=${ entry [ 1 ] } ` ;
You can’t perform that action at this time.
0 commit comments